From: Thierry Parmentelat Date: Thu, 11 Feb 2010 12:39:04 +0000 (+0000) Subject: (no commit message) X-Git-Tag: tests-5.0-2~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2d51f686c4b64ed44ca156a0bee88b6262107dc6;p=tests.git --- diff --git a/system/TestMain.py b/system/TestMain.py index dadcfaf..95c05e0 100755 --- a/system/TestMain.py +++ b/system/TestMain.py @@ -116,8 +116,6 @@ steps refer to a method in TestPlc or to a step_* module help="Used by db_dump and db_restore") parser.add_option("-v","--verbose", action="store_true", dest="verbose", default=False, help="Run in verbose mode") - parser.add_option("-q","--quiet", action="store_true", dest="quiet", default=False, - help="Run in quiet mode") parser.add_option("-i","--interactive",action="store_true",dest="interactive",default=False, help="prompts before each step") parser.add_option("-n","--dry-run", action="store_true", dest="dry_run", default=False, @@ -128,8 +126,6 @@ steps refer to a method in TestPlc or to a step_* module #default="logs/trace-@TIME@.txt", help="Trace file location") (self.options, self.args) = parser.parse_args() - if self.options.quiet: - self.options.verbose=False # no step specified if len(self.args) == 0: diff --git a/system/TestPlc.py b/system/TestPlc.py index 2d3f725..ae01d89 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -95,18 +95,21 @@ class TestPlc: 'install_sfa', 'configure_sfa', 'import_sfa', 'start_sfa', SEP, 'setup_sfa', 'add_sfa', 'update_sfa', 'view_sfa', SEP, 'nodes_ssh_debug', 'nodes_ssh_boot', 'check_slice', 'check_initscripts', SEP, + # optionally run sfa later; takes longer, but checks more about nm + # 'install_sfa', 'configure_sfa', 'import_sfa', 'start_sfa', SEP, + # 'setup_sfa', 'add_sfa', 'update_sfa', 'view_sfa', SEP, 'check_slice_sfa', 'delete_sfa', 'stop_sfa', SEP, 'check_tcp', 'check_hooks', SEP, 'force_gather_logs', 'force_local_post', ] other_steps = [ - 'fresh_install', 'stop', 'vs_start', SEP, + 'show_boxes', 'local_list','local_cleanup',SEP, + 'stop', 'vs_start', SEP, 'clean_initscripts', 'clean_nodegroups','clean_all_sites', SEP, 'clean_sites', 'clean_nodes', 'clean_slices', 'clean_keys', SEP, 'populate' , SEP, - 'show_boxes', 'list_all_qemus', 'list_qemus', 'kill_qemus', SEP, + 'list_all_qemus', 'list_qemus', 'kill_qemus', SEP, 'db_dump' , 'db_restore', SEP, - 'local_list','local_cleanup',SEP, 'standby_1 through 20', ] @@ -261,13 +264,14 @@ class TestPlc: # a step for checking this stuff def show_boxes (self): + 'print summary of nodes location' for (box,nodes) in self.gather_hostBoxes().iteritems(): print box,":"," + ".join( [ node.name() for node in nodes ] ) return True # make this a valid step def kill_all_qemus(self): - "all qemu boxes: kill all running qemus (even of former runs)" + 'kill all qemu instances on the qemu boxes involved by this setup' # this is the brute force version, kill all qemus on that host box for (box,nodes) in self.gather_hostBoxes().iteritems(): # pass the first nodename, as we don't push template-qemu on testboxes @@ -277,6 +281,7 @@ class TestPlc: # make this a valid step def list_all_qemus(self): + 'list all qemu instances on the qemu boxes involved by this setup' for (box,nodes) in self.gather_hostBoxes().iteritems(): # this is the brute force version, kill all qemus on that host box TestBox(box,self.options.buildname).list_all_qemus() @@ -284,6 +289,7 @@ class TestPlc: # kill only the right qemus def list_qemus(self): + 'list qemu instances for our nodes' for (box,nodes) in self.gather_hostBoxes().iteritems(): # the fine-grain version for node in nodes: @@ -292,6 +298,7 @@ class TestPlc: # kill only the right qemus def kill_qemus(self): + 'kill the qemu instances for our nodes' for (box,nodes) in self.gather_hostBoxes().iteritems(): # the fine-grain version for node in nodes: @@ -324,7 +331,7 @@ class TestPlc: for key in val: self.display_key_spec (key) elif passno == 1: - if key not in ['sites','initscripts','slices','keys']: + if key not in ['sites','initscripts','slices','keys', 'sfa']: print '+ ',key,':',val def display_site_spec (self,site): @@ -526,6 +533,7 @@ class TestPlc: return True def vs_start (self): + "start the PLC vserver" self.start_guest() return True @@ -537,6 +545,7 @@ class TestPlc: return True def clean_keys(self): + "removes keys cached in keys/" utils.system("rm -rf %s/keys/"%os.path(sys.argv[0])) # fetches the ssh keys in the plc's /etc/planetlab and stores them in keys/ @@ -579,6 +588,7 @@ class TestPlc: return True def clean_all_sites (self): + "Delete all sites in PLC, and related objects" print 'auth_root',self.auth_root() site_ids = [s['site_id'] for s in self.apiserver.GetSites(self.auth_root(), {}, ['site_id'])] for site_id in site_ids: @@ -1194,19 +1204,21 @@ class TestPlc: return "/root/%s-%s.sql"%(database,name) def db_dump(self): - dump=self.dbfile("planetab4") - self.run_in_guest('pg_dump -U pgsqluser planetlab4 -f '+ dump) - utils.header('Dumped planetlab4 database in %s'%dump) + 'dump the planetlab5 DB in /root in the PLC - filename has time' + dump=self.dbfile("planetab5") + self.run_in_guest('pg_dump -U pgsqluser planetlab5 -f '+ dump) + utils.header('Dumped planetlab5 database in %s'%dump) return True def db_restore(self): - dump=self.dbfile("planetab4") + 'restore the planetlab5 DB - looks broken, but run -n might help' + dump=self.dbfile("planetab5") ##stop httpd service self.run_in_guest('service httpd stop') # xxx - need another wrapper - self.run_in_guest_piped('echo drop database planetlab4','psql --user=pgsqluser template1') - self.run_in_guest('createdb -U postgres --encoding=UNICODE --owner=pgsqluser planetlab4') - self.run_in_guest('psql -U pgsqluser planetlab4 -f '+dump) + self.run_in_guest_piped('echo drop database planetlab5','psql --user=pgsqluser template1') + self.run_in_guest('createdb -U postgres --encoding=UNICODE --owner=pgsqluser planetlab5') + self.run_in_guest('psql -U pgsqluser planetlab5 -f '+dump) ##starting httpd service self.run_in_guest('service httpd start') diff --git a/system/TestPool.py b/system/TestPool.py index 5ef9497..b18777c 100644 --- a/system/TestPool.py +++ b/system/TestPool.py @@ -47,8 +47,7 @@ class TestPool: # the hostnames provided (from a tracker) are considered last def next_free (self, tracker_hostnames): - if self.options.quiet: - print 'TestPool is looking for a %s'%self.message, + utils.header('TestPool is looking for a %s'%self.message) # create 2 lists of (h,i,u) entries, the ones not in the tracker, and the ones in the tracker in_track_pool=[] out_track_pool=[] @@ -64,15 +63,9 @@ class TestPool: for (hostname,ip,user_data) in out_track_pool + in_track_pool: if hostname in self.busy: continue - if not self.options.quiet: - utils.header('TestPool : checking %s'%hostname) - else: - print '.', + utils.header('TestPool : checking %s'%hostname) if self.free_hostname(hostname): - if not self.options.quiet: - utils.header('%s is available'%hostname) - else: - print '' + utils.header('%s is available'%hostname) self.busy.append(hostname) return (hostname,ip,user_data) else: diff --git a/system/TestResources.py b/system/TestResources.py index bd42eed..40364e4 100644 --- a/system/TestResources.py +++ b/system/TestResources.py @@ -3,6 +3,7 @@ # import sys +import traceback import utils from TestMapper import TestMapper @@ -19,7 +20,6 @@ class TestResources: plcs = self.localize_qemus(plcs,options) except Exception, e: print '* Could not localize qemus','--',e,'--','exiting' - import traceback traceback.print_exc() sys.exit(1) try: @@ -86,7 +86,6 @@ class TestResources: for nodename in all_nodenames: if options.ips_node: ip_or_hostname=options.ips_node.pop() - print 'debug','in',ip_or_hostname,'out',ip_pool.locate_entry(ip_or_hostname) (hostname,ip,mac)=ip_pool.locate_entry(ip_or_hostname) else: tracker=TrackerQemu(options,instances=self.max_qemus()-1) @@ -108,7 +107,6 @@ class TestResources: def localize_plcs (self,plcs,options): - utils.header ("Turning configuration into a vserver-based one for onelab") ip_pool = TestPoolIP (self.plcs_ip_pool(),options) plc_counter=0