|
25 | 25 | os.chdir(workingPath) |
26 | 26 |
|
27 | 27 | #Get Audit Log |
28 | | - |
29 | | - #Capture Provenance |
30 | | -subprocess.call((baseCommand % ('process launch %s/test' % stagePath)).split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
31 | | - subprocess.call('trace-cmd stop'.split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
32 | | -subprocess.call(('trace-cmd extract -o %s/trace.dat' % workingPath).split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
33 | | -======= |
34 | 28 | #Config OPUS Server |
35 | 29 | pipe = subprocess.Popen(['%s/bin/opusctl' % opusPath, 'conf'], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) |
36 | 30 |
|
37 | 31 | #Choose a location for the OPUS master config |
38 | 32 | config = '%s/.opus-cfg\n' % workingPath |
39 | 33 | #Where is your OPUS installation? |
40 | | -config = '%s%s/\n' % (config,opusPath) |
| 34 | +config = '%s%s/\n' % (config, opusPath) |
41 | 35 | #Choose an address for provenance data collection. |
42 | 36 | config = '%s\n' % config |
43 | 37 | #Choose a location for the OPUS database to reside in |
44 | | -config = '%s%s/output.db\n' % (config,workingPath) |
| 38 | +config = '%s%s/output.db\n' % (config, workingPath) |
45 | 39 | #Choose a location for the OPUS bash variables cfg_file |
46 | | -config = '%s%s/.opus-vars\n' % (config,workingPath) |
| 40 | +config = '%s%s/.opus-vars\n' % (config, workingPath) |
47 | 41 | #What is the location of your python 2.7 binary? |
48 | 42 | config = '%s\n' % config |
49 | 43 | #Where is your jvm installation? |
|
55 | 49 |
|
56 | 50 | pipe.communicate(input=config.encode()) |
57 | 51 |
|
58 | | -baseCommand = '%s/bin/opusctl --conf %s/.opus-cfg %s' % (opusPath,workingPath,'%s') |
| 52 | +baseCommand = '%s/bin/opusctl --conf %s/.opus-cfg %s' % (opusPath, workingPath, '%s') |
| 53 | + |
59 | 54 | #Start Opus Server |
60 | 55 | subprocess.call((baseCommand % 'server start').split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
61 | 56 |
|
|
66 | 61 | subprocess.call('trace-cmd start -e syscalls'.split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
67 | 62 |
|
68 | 63 | #Capture Provenance |
69 | | -subprocess.call((baseCommand % ('process launch %s/%s' % (stagePath,progName))).split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
70 | | - |
| 64 | +subprocess.call((baseCommand % ('process launch %s/%s' % (stagePath, progName))).split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
| 65 | + |
71 | 66 | subprocess.call('trace-cmd stop'.split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
72 | 67 | subprocess.call(('trace-cmd extract -o %s/trace.dat' % workingPath).split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
73 | | - |
| 68 | + |
74 | 69 | #Stop Opus Server |
75 | 70 | subprocess.call((baseCommand % 'server stop').split(), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
76 | 71 |
|
|
97 | 92 | os.makedirs('%s/%s-%s' %(workingPath, suffix.split('-')[0], fingerprint)) |
98 | 93 | os.chown('%s/%s-%s' %(workingPath, suffix.split('-')[0], fingerprint), 1000, 1000) |
99 | 94 |
|
100 | | -os.rename('%s/output.db' % workingPath,'%s/%s-%s/output.db-%s-%d' % (workingPath, suffix.split('-')[0], fingerprint, suffix, i)) |
| 95 | +os.rename('%s/output.db' % workingPath, '%s/%s-%s/output.db-%s' % (workingPath, suffix.split('-')[0], fingerprint, suffix)) |
101 | 96 |
|
102 | 97 | print(fingerprint) |
0 commit comments