rendered paste body#!/usr/bin/python#program:import osdef newline(): print '\n'## tests each app by running themdef app_test(a, b, c): auto_menu = '' if os.system(a) == 0: auto_menu = auto_menu + 'a' elif os.system(a) == 1: auto_menu = auto_menu + x else: auto_menu = auto_menu + x if os.system(b) == 0: auto_menu = auto_menu + 'b' elif os.system(b) == 1: auto_menu = auto_menu + x else: auto_menu = auto_menu + x if os.system(c) == 0: auto_menu = auto_menu + 'c' elif os.system(c) == 1: auto_menu = auto_menu + x else: auto_menu = auto_menu + x #print auto_menu if auto_menu == 'abc': return auto_menu else: return auto_menu## touch the compression test, test dataos.system('touch /tmp/test.me')## setup the varibles that handle the programsprog_zip = 'zip'prog_bzip = 'bzip2'prog_tar = 'tar'#prog_lzma =## set other varibles neededmenu_type = ''## set up the command lines for the testprog_a = prog_bzip + ' -9fkvv /tmp/test.me &> /dev/null'prog_b = prog_zip + ' -h &> /dev/null'prog_c = prog_tar + ' --help &> /dev/null'#prog_d = prog_lzma + ''## Pass the above varibles to the test loop and prints them#print app_test(prog_a, prog_b, prog_c)zeo = app_test(prog_a, prog_b,prog_c)if zeo == 'abc': menu_type = 123elif zeo == 'bc': menu_type = 23elif zeo == 'ab': menu_type = 12elif zeo == 'ac': menu_type = 13else: menu_type = 000print zeoprint menu_type##remove the test file#os.system('rm /tmp/test.me*')