diff options
author | Mac Mollison <mollison@cs.unc.edu> | 2009-03-21 20:34:51 -0400 |
---|---|---|
committer | Mac Mollison <mollison@cs.unc.edu> | 2009-03-21 20:34:51 -0400 |
commit | b61c626347efe68eccfb806dca32a4dd6876ebd1 (patch) | |
tree | 582de73b26cbfe90b9104db0734b86b233b39f38 | |
parent | 42174e7384ef799d8473074eedffdb8108a145c7 (diff) |
The very preliminary test driver now runs correctly
-rw-r--r-- | test_driver/test.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test_driver/test.py b/test_driver/test.py index 236f52e..68fdafb 100644 --- a/test_driver/test.py +++ b/test_driver/test.py | |||
@@ -9,18 +9,21 @@ liblitmus_dir = '/root/liblitmus/' | |||
9 | ft_trace_dir = '/root/ft_trace/' | 9 | ft_trace_dir = '/root/ft_trace/' |
10 | 10 | ||
11 | #device files directory | 11 | #device files directory |
12 | #You should put the make_devices program into this directory, and chmod +x it. | ||
13 | device_dir = '/root/device_files/' | 12 | device_dir = '/root/device_files/' |
14 | 13 | ||
15 | #desired scheduling policy | 14 | #desired scheduling policy |
16 | #options listed in /proc/litmus/plugins | 15 | #options listed in /proc/litmus/plugins |
17 | policy = 'GSN-EDF' | 16 | policy = 'GSN-EDF' |
18 | 17 | ||
18 | #Additional instructions: | ||
19 | # -Make sure you've chmod +x'd the make_devices file and kept it in the same | ||
20 | # dir as test.py | ||
19 | 21 | ||
20 | ########### | 22 | ########### |
21 | # Imports # | 23 | # Imports # |
22 | ########### | 24 | ########### |
23 | 25 | ||
26 | import subprocess | ||
24 | import os | 27 | import os |
25 | 28 | ||
26 | 29 | ||
@@ -30,17 +33,20 @@ import os | |||
30 | 33 | ||
31 | def main(): | 34 | def main(): |
32 | 35 | ||
36 | #Determine directory of test.py | ||
37 | test_dir = os.getcwd() | ||
38 | |||
33 | #Set scheduling policy | 39 | #Set scheduling policy |
34 | os.system('cat ' + policy + ' > ' + '/proc/litmus/active_policy') | 40 | subprocess.Popen('echo ' + policy + ' > ' + '/proc/litmus/active_plugin', |
41 | shell=True) | ||
35 | 42 | ||
36 | #Setup the device files for the traces | 43 | #Setup the device files for the traces |
37 | os.system(device_dir + 'make_devices') | 44 | subprocess.Popen('chmod +x make_devices',shell=True) |
45 | subprocess.Popen(test_dir + '/make_devices',cwd=device_dir) | ||
38 | 46 | ||
39 | #Set up environment variables needed for st_trace script | 47 | #Set up environment variables needed for st_trace script |
40 | os.system('FTCAT=' + ft_trace_dir + 'ftcat') | 48 | os.putenv('FTCAT', ft_trace_dir + 'ftcat') |
41 | os.system('FTDEV=' + device_dir) | 49 | os.putenv('FTDEV',device_dir) |
42 | os.system('export FTCAT') | ||
43 | os.system('export FTDEV') | ||
44 | 50 | ||
45 | #Current steps... | 51 | #Current steps... |
46 | #Run st_trace | 52 | #Run st_trace |