mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 3 | # Copyright (C) 2006 - 2007 Michal Piotrowski <michal.k.k.piotrowski@gmail.com> |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 2 of the License, or |
| 8 | # (at your option) any later version. |
| 9 | |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 10 | import os, sys, dircache, string, dialog, time |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 11 | from menu_lib import * |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 12 | |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 13 | def handle_exit_code(d, code): |
| 14 | if code in (d.DIALOG_CANCEL, d.DIALOG_ESC): |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 15 | if d.yesno("Do you want to exit Autotest Control Center?") == d.DIALOG_OK: |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 16 | sys.exit(0) |
| 17 | return 0 |
| 18 | else: |
| 19 | return 1 |
| 20 | |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 21 | def atcc_t_menu(test_type, t): |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 22 | u = atcc_list_control_files(test_type, at_dir) |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 23 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 24 | (code, tag) = d.checklist(text = test_type + ":", choices = u, title = t) |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 25 | |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 26 | return tag |
| 27 | |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 28 | def atcc_t_run(res, test_type): |
| 29 | if len(res) == 0: |
| 30 | return -1 |
| 31 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 32 | atcc_setup_tmp_dirs_files(menu_dir) |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 33 | |
| 34 | for i in res: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 35 | os.system(at_dir + '/bin/autotest ' + at_dir + '/' + test_type + '/' + i) |
| 36 | atcc_save_results1(i, at_dir, menu_dir) |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 37 | |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 38 | def atcc_t_p_run(res, test_type): |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 39 | if len(res) == 0: |
| 40 | return -1 |
| 41 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 42 | atcc_setup_tmp_dirs_files(menu_dir) |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 43 | |
| 44 | file = (menu_dir + '/tmp/parallel') |
| 45 | f = open(file, 'w') |
| 46 | |
| 47 | for i in res: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 48 | z = i.split('/') |
| 49 | line = ("def " + z[0] + "():\n") |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 50 | z = str(line) |
| 51 | f.write(z) |
| 52 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 53 | file = (at_dir + '/' + test_type + '/' + i) |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 54 | f2 = open(file, 'r') |
| 55 | k = f2.readlines() |
| 56 | |
| 57 | for i in k: |
| 58 | x = ("\t" + i + "\n") |
| 59 | z = str(x) |
| 60 | f.write(z) |
| 61 | |
| 62 | f2.close() |
| 63 | |
| 64 | f.write('job.parallel(') |
| 65 | |
| 66 | for i in range(len(res)): |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 67 | z = res[i].split('/') |
| 68 | z = ('[' + z[0] + '],') |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 69 | z = str(z) |
| 70 | f.write(z) |
| 71 | |
| 72 | f.write(')') |
| 73 | |
| 74 | f.close() |
| 75 | |
| 76 | os.system(at_dir + '/bin/autotest ' + menu_dir + '/tmp/parallel') |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 77 | atcc_save_results1("", at_dir, menu_dir) |
| 78 | |
| 79 | def atcc_profilers_run(res1, res2): |
| 80 | if len(res1) == 0 or len(res2) == 0: |
| 81 | return -1 |
| 82 | |
| 83 | atcc_setup_tmp_dirs_files(menu_dir) |
| 84 | |
| 85 | file = (menu_dir + '/tmp/profilers') |
| 86 | f = open(file, 'w') |
| 87 | |
| 88 | f.write('for profiler in (') |
| 89 | |
| 90 | for i in range(len(res1)): |
| 91 | z = res1[i].split('/') |
| 92 | z = ('\'' + z[0] + '\', ') |
| 93 | z = str(z) |
| 94 | f.write(z) |
| 95 | |
| 96 | f.write('):\n') |
| 97 | |
| 98 | f.write('\ttry:\n') |
| 99 | f.write('\t\tprint "Testing profiler %s ..." % profiler\n') |
| 100 | f.write('\t\tjob.profilers.add(profiler)\n') |
| 101 | |
| 102 | for i in range(len(res2)): |
| 103 | z = atcc_control_file_read(res2[i], 'tests', at_dir) |
| 104 | n = res2[i].split('/') |
| 105 | k = ('\t\tjob.run_test(\'' + n[0] + '\',' + z + ')\n') |
| 106 | k = str(k) |
| 107 | f.write(k) |
| 108 | |
| 109 | f.write('\t\tjob.profilers.delete(profiler)\n') |
| 110 | f.write('\texcept:\n') |
| 111 | f.write('\t\tprint "Test of profiler %s failed" % profiler\n') |
| 112 | f.write('\t\traise\n') |
| 113 | |
| 114 | f.close() |
| 115 | |
| 116 | os.system(at_dir + '/bin/autotest ' + menu_dir + '/tmp/profilers') |
| 117 | atcc_save_results2(res1, res2, at_dir, menu_dir) |
| 118 | |
| 119 | def atcc_remote_get_ip(): |
| 120 | while 1: |
| 121 | (code, answer) = d.inputbox("IP address of remote host", init = "192.168.0.1") |
| 122 | |
| 123 | if code == d.DIALOG_CANCEL or code == d.DIALOG_ESC: |
| 124 | break |
| 125 | return answer |
| 126 | |
| 127 | def atcc_t_remote_run(ip, res, test_type): |
| 128 | if len(res) == 0: |
| 129 | return -1 |
| 130 | |
| 131 | atcc_setup_tmp_dirs_files(menu_dir) |
| 132 | |
| 133 | file = (menu_dir + '/tmp/remote_test') |
| 134 | f = open(file, 'w') |
| 135 | |
| 136 | st = str("remote_host = hosts.SSHHost(\"" + ip +"\")") |
| 137 | f.write(st + "\n") |
| 138 | st = str("at = autotest.Autotest()") |
| 139 | f.write(st + "\n") |
| 140 | |
| 141 | file2 = (menu_dir + '/tmp/remote_control') |
| 142 | f2 = open(file2, 'w') |
| 143 | |
| 144 | for i in res: |
| 145 | print i |
| 146 | file3 = (at_dir + '/' + test_type + '/' + i) |
| 147 | f3 = open(file3, 'r') |
| 148 | k = f3.readlines() |
| 149 | for i in k: |
| 150 | x = (i + "\n") |
| 151 | z = str(x) |
| 152 | f2.write(z) |
| 153 | f3.close() |
| 154 | |
| 155 | f2.close() |
| 156 | st = str("at.run(\"" + menu_dir + "/tmp/remote_control\",\"results\", remote_host)") |
| 157 | f.write(st + "\n") |
| 158 | f.close() |
| 159 | |
| 160 | os.system(srv_dir + '/autoserv ' + menu_dir + '/tmp/remote_test') |
| 161 | |
| 162 | def atcc_t_p_remote_run(ip, res, test_type): |
| 163 | if len(res) == 0: |
| 164 | return -1 |
| 165 | |
| 166 | atcc_setup_tmp_dirs_files(menu_dir) |
| 167 | |
| 168 | file = (menu_dir + '/tmp/remote_parallel_control') |
| 169 | f = open(file, 'w') |
| 170 | |
| 171 | for i in res: |
| 172 | z = i.split('/') |
| 173 | line = ("def " + z[0] + "():\n") |
| 174 | z = str(line) |
| 175 | f.write(z) |
| 176 | |
| 177 | file = (at_dir + '/' + test_type + '/' + i) |
| 178 | f2 = open(file, 'r') |
| 179 | k = f2.readlines() |
| 180 | |
| 181 | for i in k: |
| 182 | x = ("\t" + i + "\n") |
| 183 | z = str(x) |
| 184 | f.write(z) |
| 185 | |
| 186 | f2.close() |
| 187 | |
| 188 | f.write('job.parallel(') |
| 189 | |
| 190 | for i in range(len(res)): |
| 191 | z = res[i].split('/') |
| 192 | z = ('[' + z[0] + '],') |
| 193 | z = str(z) |
| 194 | f.write(z) |
| 195 | |
| 196 | f.write(')') |
| 197 | |
| 198 | f.close() |
| 199 | |
| 200 | file = (menu_dir + '/tmp/remote_parallel_test') |
| 201 | f = open(file, 'w') |
| 202 | |
| 203 | st = str("remote_host = hosts.SSHHost(\"" + ip +"\")") |
| 204 | f.write(st + "\n") |
| 205 | st = str("at = autotest.Autotest()") |
| 206 | f.write(st + "\n") |
| 207 | |
| 208 | st = str("at.run(\"" + menu_dir + "/tmp/remote_parallel_control\",\"results\", remote_host)") |
| 209 | f.write(st + "\n") |
| 210 | f.close() |
| 211 | |
| 212 | os.system(srv_dir + '/autoserv ' + menu_dir + '/tmp/remote_parallel_test') |
| 213 | |
| 214 | def atcc_profilers_remote_run(ip, res1, res2): |
| 215 | if len(res1) == 0 or len(res2) == 0: |
| 216 | return -1 |
| 217 | |
| 218 | atcc_setup_tmp_dirs_files(menu_dir) |
| 219 | |
| 220 | file = (menu_dir + '/tmp/remote_profilers_control') |
| 221 | f = open(file, 'w') |
| 222 | |
| 223 | f.write('for profiler in (') |
| 224 | |
| 225 | for i in range(len(res1)): |
| 226 | z = res1[i].split('/') |
| 227 | z = ('\'' + z[0] + '\', ') |
| 228 | z = str(z) |
| 229 | f.write(z) |
| 230 | |
| 231 | f.write('):\n') |
| 232 | |
| 233 | f.write('\ttry:\n') |
| 234 | f.write('\t\tprint "Testing profiler %s ..." % profiler\n') |
| 235 | f.write('\t\tjob.profilers.add(profiler)\n') |
| 236 | |
| 237 | for i in range(len(res2)): |
| 238 | z = atcc_control_file_read(res2[i], 'tests', at_dir) |
| 239 | n = res2[i].split('/') |
| 240 | k = ('\t\tjob.run_test(\'' + n[0] + '\',' + z + ')\n') |
| 241 | k = str(k) |
| 242 | f.write(k) |
| 243 | |
| 244 | f.write('\t\tjob.profilers.delete(profiler)\n') |
| 245 | f.write('\texcept:\n') |
| 246 | f.write('\t\tprint "Test of profiler %s failed" % profiler\n') |
| 247 | f.write('\t\traise\n') |
| 248 | |
| 249 | f.close() |
| 250 | |
| 251 | file = (menu_dir + '/tmp/remote_profilers') |
| 252 | f = open(file, 'w') |
| 253 | |
| 254 | st = str("remote_host = hosts.SSHHost(\"" + ip +"\")") |
| 255 | f.write(st + "\n") |
| 256 | st = str("at = autotest.Autotest()") |
| 257 | f.write(st + "\n") |
| 258 | |
| 259 | st = str("at.run(\"" + menu_dir + "/tmp/remote_profilers_control\",\"results\", remote_host)") |
| 260 | f.write(st + "\n") |
| 261 | f.close() |
| 262 | |
| 263 | os.system(srv_dir + '/autoserv ' + menu_dir + '/tmp/remote_profilers') |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 264 | |
| 265 | def atcc_tests_results(t): |
| 266 | if os.path.exists(menu_dir + "/tmp/"): |
| 267 | dir_ls = dircache.listdir(menu_dir + "/tmp/") |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 268 | else: |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 269 | d.infobox(menu_dir + "/tmp/ doesn't exist") |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 270 | time.sleep(5) |
| 271 | return -1 |
| 272 | |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 273 | if len(dir_ls) == 0: |
| 274 | return -1 |
| 275 | |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 276 | u = [] |
| 277 | |
| 278 | for i in dir_ls: |
| 279 | k = i, "" |
| 280 | u.append(k) |
| 281 | |
| 282 | while 1: |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 283 | (code, tag) = d.menu("Results:", choices = u, title = t) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 284 | |
| 285 | if code == d.DIALOG_CANCEL or code == d.DIALOG_ESC: |
| 286 | break |
| 287 | else: |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 288 | d.textbox(menu_dir + '/tmp/' + tag, width = -1) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 289 | |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 290 | def atcc_config_show_help(tag, test_type): |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 291 | tag = tag.split('/') |
| 292 | tag = tag[0] |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 293 | if os.path.exists(at_dir + '/' + test_type + '/' + tag + '/help'): |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 294 | d.textbox(at_dir + '/' + test_type + '/' + tag + '/help', width = -1) |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 295 | else: |
| 296 | d.infobox(at_dir + '/' + test_type + '/' + tag + '/help' " doesn't exist") |
| 297 | time.sleep(5) |
| 298 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 299 | def atcc_config_edit(tag, test_type, ed): |
| 300 | os.system(ed + " " + at_dir + '/' + test_type + '/' + tag) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 301 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 302 | def atcc_config_help_or_edit(tag, test_type): |
| 303 | ed = "vim" |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 304 | while 1: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 305 | (code, answer) = d.inputbox("Type 'help' to see documentation, or name of favourite text editor", init = ed) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 306 | |
| 307 | if code == d.DIALOG_CANCEL or code == d.DIALOG_ESC: |
| 308 | break |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 309 | elif answer == "help": |
| 310 | atcc_config_show_help(tag, test_type) |
| 311 | continue |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 312 | else: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 313 | ed = answer |
| 314 | atcc_config_edit(tag, test_type, ed) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 315 | break |
| 316 | |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 317 | def atcc_config_choose_control_file(test_type, t): |
| 318 | u_tmp = atcc_list_control_files(test_type, at_dir) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 319 | u = [] |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 320 | for i in u_tmp: |
| 321 | k = i[0], "" |
| 322 | u.append(k) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 323 | |
| 324 | while 1: |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 325 | (code, tag) = d.menu(test_type + ":", choices = u, title = t) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 326 | |
| 327 | if code == d.DIALOG_CANCEL or code == d.DIALOG_ESC: |
| 328 | break |
| 329 | else: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 330 | atcc_config_help_or_edit(tag, test_type) |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 331 | |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 332 | def atcc_upgrade(): |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 333 | os.system("svn checkout svn://test.kernel.org/autotest/trunk " + at_dir + "/../") |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 334 | |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 335 | def atcc_rsync_mirror(): |
mbligh | ee297ae | 2007-02-21 22:06:27 +0000 | [diff] [blame] | 336 | os.system(at_dir + "/../mirror/mirror") |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 337 | |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 338 | def atcc_main_menu(): |
| 339 | while 1: |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 340 | (code, tag) = d.menu("Main menu", |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 341 | choices = [("1", "Tests (local)"), |
| 342 | ("2", "Parallel tests (local)"), |
| 343 | ("3", "Profilers (local)"), |
| 344 | ("4", "Tests (remote)"), |
| 345 | ("5", "Parallel tests (remote)"), |
| 346 | ("6", "Profilers (remote)"), |
| 347 | ("7", "Tests' results"), |
| 348 | ("8", "Configure tests"), |
| 349 | ("9", "Upgrade Autotest"), |
| 350 | ("10", "Sync local kernel.org mirror")]) |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 351 | if handle_exit_code(d, code): |
| 352 | break |
| 353 | return tag |
| 354 | |
| 355 | def main(): |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 356 | while 1: |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 357 | res = int(atcc_main_menu()) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 358 | if res == 1: |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 359 | res = atcc_t_menu(test_type = 'tests', t = 'Tests selection menu') |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 360 | atcc_t_run(res, test_type = 'tests') |
| 361 | elif res == 2: |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 362 | res = atcc_t_menu(test_type = 'tests', t = 'Parallel tests selection menu') |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 363 | atcc_t_p_run(res, test_type = 'tests') |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 364 | elif res == 3: |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 365 | res1 = atcc_t_menu(test_type = 'profilers', t = 'Profilers selection menu') |
| 366 | res2 = atcc_t_menu(test_type = 'tests', t = 'Tests selection menu') |
| 367 | atcc_profilers_run(res1, res2) |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 368 | elif res == 4: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 369 | ip = atcc_remote_get_ip() |
| 370 | res = atcc_t_menu(test_type = 'tests', t = 'Tests selection menu') |
| 371 | atcc_t_remote_run(ip, res, test_type = 'tests') |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 372 | elif res == 5: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 373 | ip = atcc_remote_get_ip() |
| 374 | res = atcc_t_menu(test_type = 'tests', t = 'Parallel tests selection menu') |
| 375 | atcc_t_p_remote_run(ip, res, test_type = 'tests') |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 376 | elif res == 6: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 377 | ip = atcc_remote_get_ip() |
| 378 | res1 = atcc_t_menu(test_type = 'profilers', t = 'Profilers selection menu') |
| 379 | res2 = atcc_t_menu(test_type = 'tests', t = 'Tests selection menu') |
| 380 | atcc_profilers_remote_run(ip, res1, res2) |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 381 | elif res == 7: |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 382 | atcc_tests_results(t = 'Tests\' results menu') |
| 383 | elif res == 8: |
| 384 | atcc_config_choose_control_file(test_type = 'tests', t = 'Tests configuration menu') |
| 385 | elif res == 9: |
| 386 | atcc_upgrade() |
| 387 | elif res == 10: |
mbligh | 0d67fa8 | 2006-10-12 04:37:34 +0000 | [diff] [blame] | 388 | atcc_rsync_mirror() |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 389 | elif res == 0: |
| 390 | sys.exit(1) |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 391 | |
| 392 | check_python_version() |
| 393 | |
mbligh | 2615f97 | 2006-09-30 15:19:48 +0000 | [diff] [blame] | 394 | menu_dir = os.path.abspath(os.path.dirname(sys.argv[0])) |
mbligh | ee297ae | 2007-02-21 22:06:27 +0000 | [diff] [blame] | 395 | at_dir = os.path.dirname(menu_dir + "/../client/") |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 396 | srv_dir = os.path.dirname(menu_dir + "/../server/") |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 397 | |
mbligh | 5e753ac | 2006-10-04 03:50:45 +0000 | [diff] [blame] | 398 | d = dialog.Dialog(dialog = "dialog") |
mbligh | 4a70c13 | 2007-07-17 20:46:28 +0000 | [diff] [blame] | 399 | d.add_persistent_args(["--backtitle", "Autotest Control Center v0.07"]) |
mbligh | be2ac85 | 2006-09-28 04:44:30 +0000 | [diff] [blame] | 400 | |
| 401 | main() |