forked from includeos/IncludeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·33 lines (25 loc) · 892 Bytes
/
test.py
File metadata and controls
executable file
·33 lines (25 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
from __future__ import print_function
from builtins import str
import sys
import os
import subprocess
thread_timeout = 30
includeos_src = os.environ.get('INCLUDEOS_SRC',
os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))).split('/test')[0])
sys.path.insert(0,includeos_src)
from vmrunner import vmrunner
# Get an auto-created VM from the vmrunner
vm = vmrunner.vms[0]
def cleanup():
# Call the cleanup script - let python do the printing to get it synced
print(subprocess.check_output(["./fat32_disk.sh", "clean"]))
# Setup disk
subprocess.call(["./fat32_disk.sh"], shell=True, timeout = thread_timeout)
# Clean up on exit
vm.on_exit(cleanup)
# Boot the VM
if len(sys.argv) > 1:
vm.boot(thread_timeout,image_name=str(sys.argv[1]))
else:
vm.boot(thread_timeout,image_name='fs_ide_write.elf.bin')