MARSSx86에서 simulation이 끝난 뒤에 메일 전송하기

MARSSx86에서는 simulation이 끝났음을 메일로 알리는 기능을 제공한다. 여러 개의 실험을 동시에 하는 경우에 이 기능을 쓸 수 있다.

1. xoauth.txt 생성
MARSSx86는 xoauth.txt를 생성할 수 있는 툴을 제공한다. (./util/
아무 인자도 주지 않고 실행하면 사용법을 출력한다.

$python ./util/
Usage: Utilities for XOAUTH authentication.

This script has the following modes of operation:

The --generate_oauth_token mode will generate and authorize an OAuth token for

  xoauth --generate_oauth_token

The script will converse with Google Accounts and generate an oauth request
token, then present you with a URL you should visit in your browser to authorize
the token. Once you get the verification code from the website, enter it into
the script to get your OAuth access token. The output from this command will be
two values: an OAuth token and an OAuth token secret. These values are reusable,so if you save them somewhere you won't have to keep repeating this first step.

The --generate_xoauth_string option generates an XOauth auth string that can
be fed directly to IMAP or SMTP.

(3-legged OAuth)
  xoauth --generate_xoauth_string
    --oauth_token=k99hfs9dh --oauth_token_secret=sd9fhidfskfj
(2-legged OAuth)
  xoauth --generate_xoauth_string --consumer_secret=sd9fhidfskfj
The output of this mode will be a base64-encoded string. To use it, connect to and pass it as the second argument to the AUTHENTICATE

  a AUTHENTICATE XOAUTH a9sha9sfs[...]9dfja929dk==

The --test_imap_authentication and --test_smtp_authentication comands generate
an XOAUTH string and use them to authenticate to a live IMAP or SMTP server.
You can use the --imap_hostname and --smtp_hostname options to specify the
server to connect to.

  xoauth --test_imap_authentication
    --oauth_token=k99hfs9dh --oauth_token_secret=sd9fhidfskfj

  xoauth --test_smtp_authentication
    --oauth_token=k99hfs9dh --oauth_token_secret=sd9fhidfskfj

  -h, --help            show this help message and exit
                        generates an OAuth token for testing
                        generates an initial client response for XOAUTH
                        tests authenticating to IMAP with XOAUTH
                        tests authenticating to SMTP with XOAUTH
                        (3-legged OAuth) oauth access token
                        (3-legged OAuth) oauth access token secret
                        request URL for xoauth request
  --user=USER           email address of user for xoauth request
  --scope=SCOPE         scope for the access token. Multiple scopes can be
                        listed separated by spaces with the whole argument
  --nonce=NONCE         optional nonce for computation. If not supplied, a
                        random value will be used
                        optional timestamp for computation. If not supplied,
                        the current time will be used.
  --proto=PROTO         The protocol string to embed in the request URL. Valid
                        examples are "imap" and "smtp".
                        (2-legged OAuth) the xoauth_requestor_id parameter
                        (2-legged OAuth) The consumer key
                        (2-legged OAuth) The consumer secret
                        hostname of IMAP service
                        hostname of SMTP service
                        output file with xoauth information

./util/xoauth.py를 다음의 인자를 주어 실행하면 xoauth.txt를 생성할 수 있다.

$ python ./util/ --generate_oauth_token
RESPONSE=' oauth_token=XXX&oauth_token_secret=XXX&oauth_callback_confirmed=true '
oauth_token_secret: XXX
oauth_token: XXX
oauth_callback_confirmed: true
To authorize token, visit this url and follow the directions to generate a verification code:
Enter verification code: 

링크에 접속하면 다음과 같은 페이지를 볼 수 있다.
MARSSx86 xoauth

인증 코드를 받아 이를 입력해주면 xoauth.txt가 생성된다.

2. ./util/util.cfg 수정
xoauth.txt의 경로를 ./util/util.cfg에 입력한다.

marss_dir = /your/local/marss/directory
util_dir = %(marss_dir)s/util
img_dir = /your/disk/image/dir
qemu_bin = %(marss_dir)s/qemu/qemu-system-x86_64
default_simconfig = -kill-after-run -quiet
xoauth = /path/to/xoauth/xoauth.txt
to =
[suite spec-int]
checkpoints = gcc, bzip2, sphinx, mcf
[run spec-int-ooo]
suite = spec-int
images = %(img_dir)s/spec2006.qcow2
memory = 2G
simconfig = -logfile %(out_dir)s/%(bench)s.log
  -stats %(out_dir)s/%(bench)s.yml
  -machine ooo

3. Simulation 실행
./util/run_bench.py를 사용해 simulation을 할 때 -e 옵션을 주면 된다.

$./util/ -d run/spec_int_results -e spec-int-ooo

구글에서 더이상 OAuth 1.0을 지원하지 않는다.
MARSS의 기본 스크립트로는 메일을 보낼 수 없다.

References :
[1] MARSSx86 – Micro-ARchitectural and System Simulator for x86-based Systems,
[2] MARSSx86, 허태경,
[3] Batch Runs, MARSSx86,

Tagged with: , , , , , ,
Posted in 2) Computer Engineering

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Recent Posts
누적 방문자 수
  • 113,750 hits
%d bloggers like this: