Rev 9342 | Rev 9919 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9342 | Rev 9369 | ||
---|---|---|---|
Line 75... | Line 75... | ||
75 | raise TestTimeoutException() |
75 | raise TestTimeoutException() |
Line 76... | Line 76... | ||
76 | 76 | ||
77 | def wait(self, seconds = 0.25): |
77 | def wait(self, seconds = 0.25): |
Line 78... | Line -... | ||
78 | time.sleep(seconds) |
- | |
79 | - | ||
80 | def get_file_directory(path): |
- | |
81 | path = path.replace("\\", "/") |
- | |
82 | if "/" in path: |
- | |
83 | folder = "/".join(path.split("/")[:-1]) |
- | |
84 | if folder == "": |
- | |
85 | return "/" # It was a file in the root folder |
- | |
86 | return folder |
- | |
87 | else: |
- | |
88 | return "." # Just a filename, let's return current folder |
78 | time.sleep(seconds) |
89 | 79 | ||
90 | def run_qemu(root_dir, test_dir, debug_log): |
80 | def run_qemu(root_dir, test_dir, debug_log): |
91 | # Make local copy of IMG, so we will be able to run the test in parallel |
81 | # Make local copy of IMG, so we will be able to run the test in parallel |
92 | if os.path.exists(f"{test_dir}/kolibri_test.img"): # If previous test run interrupted the file may be busy |
82 | if os.path.exists(f"{test_dir}/kolibri_test.img"): # If previous test run interrupted the file may be busy |
Line 102... | Line 92... | ||
102 | flags += "-vga vmware " |
92 | flags += "-vga vmware " |
103 | flags += "-net nic,model=rtl8139 -net user " |
93 | flags += "-net nic,model=rtl8139 -net user " |
104 | flags += "-soundhw ac97 " |
94 | flags += "-soundhw ac97 " |
105 | if is_win32(): |
95 | if is_win32(): |
106 | qemu_full_path = shutil.which(qemu_command) |
96 | qemu_full_path = shutil.which(qemu_command) |
107 | qemu_directory = get_file_directory(qemu_full_path) |
97 | qemu_directory = os.path.dirname(qemu_full_path) |
108 | flags += f"-L {qemu_directory} " |
98 | flags += f"-L {qemu_directory} " |
109 | s = f"{qemu_command} {flags}" |
99 | s = f"{qemu_command} {flags}" |
110 | qemu_stdout = open(f"{test_dir}/qemu_stdout.log", "w") |
100 | qemu_stdout = open(f"{test_dir}/qemu_stdout.log", "w") |
111 | qemu_stderr = open(f"{test_dir}/qemu_stderr.log", "w") |
101 | qemu_stderr = open(f"{test_dir}/qemu_stderr.log", "w") |
112 | if is_win32(): |
102 | if is_win32(): |