From: Thierry Parmentelat Date: Tue, 23 Sep 2008 11:29:47 +0000 (+0000) Subject: merged trunk into 4.2 branch X-Git-Tag: tests-4.2-8~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b1c622fd0b95c48f2abffcabcb5a82e8f3fcdd3a;p=tests.git merged trunk into 4.2 branch --- diff --git a/system/Makefile b/system/Makefile index 10f2063..b3b9f64 100644 --- a/system/Makefile +++ b/system/Makefile @@ -1,16 +1,26 @@ tags: find . '(' -name '*.py' -o -name 'qemu-*' ')' | grep -v '.svn/' | xargs etags +.PHONY: tags -LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude 'arg*' +#################### + +########## make sync PLCHOST=hostname VSERVER=vservername +ifdef PLCHOST +ifdef BUILDNAME +PLCSSH:=root@$(PLCHOST):$(BUILDNAME) +endif +endif + +LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude 'arg*' RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,) RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) sync: -ifeq (,$(RSYNC_URL)) - echo "sync: You must define target host as RSYNC_URL on the command line" - echo " e.g. make sync RSYNC_URL=root@testbox1:workdir" ; exit 1 +ifeq (,$(PLCSSH)) + echo "sync: You must define PLCHOST and BUILDNAME on the command line" + echo " e.g. make sync PLCHOST=private.onelab.eu BUILDNAME=" ; exit 1 else - +$(RSYNC) ./ $(RSYNC_URL)/ + +$(RSYNC) ./ $(PLCSSH) endif diff --git a/system/TestApiserver.py b/system/TestApiserver.py index 1a82408..f030ef4 100644 --- a/system/TestApiserver.py +++ b/system/TestApiserver.py @@ -34,6 +34,7 @@ server_methods = [ ('GetNodes' , []), ('DeletePerson' , True), ('AddPersonKey' , True), ('GetPlcRelease', {'build': {'target-arch':'i386'}}), + ('GetSites', []), ] class TestApiserver: diff --git a/system/TestKey.py b/system/TestKey.py index 4df0b48..d1af805 100644 --- a/system/TestKey.py +++ b/system/TestKey.py @@ -17,17 +17,17 @@ class TestKey: def privatepath(self): return "keys/%s.rsa"%(self.name()) - def store_remote_key(self,hostname): - #Not tested yet, don't know if needed - pub=self.publicpath() - priv=self.privatepath() - utils.header("Storing key %s in %s into %s "%(self.name(),pub,hostname)) - dir=os.path.dirname(pub) - self.test_ssh.run("mkdir %s"%dir) - self.test_ssh.run("cat %s >> %s"%(self.key_spec['key_fields']['key'],pub)) - self.test_ssh.run("cat %s >> %s"%(self.key_spec['private'],priv)) - self.test_ssh.run("chmod %s 0400"%priv) - self.test_ssh.run("chmod %s 0444"%pub) +#Not tested yet, don't know if needed +# def store_remote_key(self,hostname): +# pub=self.publicpath() +# priv=self.privatepath() +# utils.header("Storing key %s in %s into %s "%(self.name(),pub,hostname)) +# dir=os.path.dirname(pub) +# self.test_ssh.run("mkdir %s"%dir) +# self.test_ssh.run("cat %s >> %s"%(self.key_spec['key_fields']['key'],pub)) +# self.test_ssh.run("cat %s >> %s"%(self.key_spec['private'],priv)) +# self.test_ssh.run("chmod %s 0400"%priv) +# self.test_ssh.run("chmod %s 0444"%pub) def store_key(self): pub=self.publicpath() diff --git a/system/TestMain.py b/system/TestMain.py index fec8e1d..c99fe85 100755 --- a/system/TestMain.py +++ b/system/TestMain.py @@ -59,11 +59,11 @@ steps refer to a method in TestPlc or to a step_* module parser.add_option("-c","--config",action="callback", callback=TestMain.optparse_list, dest="config", nargs=1,type="string", help="Config module - can be set multiple times, or use quotes") - parser.add_option("-p","--personality",action="store", dest="personality", + parser.add_option("-p","--personality",action="store", dest="personality", help="personality - as in vbuild-nightly") - parser.add_option("-d","--pldistro",action="store", dest="pldistro", + parser.add_option("-d","--pldistro",action="store", dest="pldistro", help="pldistro - as in vbuild-nightly") - parser.add_option("-f","--fcdistro",action="store", dest="fcdistro", + parser.add_option("-f","--fcdistro",action="store", dest="fcdistro", help="fcdistro - as in vbuild-nightly") parser.add_option("-x","--exclude",action="callback", callback=TestMain.optparse_list, dest="exclude", nargs=1,type="string",default=[], diff --git a/system/TestNode.py b/system/TestNode.py index 5c2104e..57806e1 100644 --- a/system/TestNode.py +++ b/system/TestNode.py @@ -1,4 +1,4 @@ -import os, sys, time, base64 +import sys, os, os.path, time, base64 import xmlrpclib import utils @@ -208,3 +208,31 @@ class TestNode: def clear_known_hosts (self): TestSsh(self.name()).clear_known_hosts() return True + + def create_test_ssh(self): + # get the plc's keys for entering the node + vservername=self.test_plc.vservername + # assuming we've run testplc.fetch_keys() + key = "keys/%(vservername)s.rsa"%locals() + return TestSsh(self.name(), buildname=self.buildname(), key=key) + + def check_sanity (self): + extensions = [ 'py','pl','sh' ] + path='tests/qaapi/qa/tests/node/' + scripts=utils.locate_sanity_scripts ('node '+self.name(), path,extensions) + overall = True + for script in scripts: + if not self.check_sanity_script (script): + overall = False + return overall + + def check_sanity_script (self,local_script): + # push the script on the node's root context + ssh_handle=self.create_test_ssh() + ssh_handle.copy_home(local_script) + script_name=os.path.basename(local_script) + if ssh_handle.run("./"+script_name) != 0: + print "WARNING: sanity check script %s FAILED"%script_name + # xxx - temporary : always return true for now + #return False + return True diff --git a/system/TestPlc.py b/system/TestPlc.py index 4e6027f..ca70681 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -63,16 +63,17 @@ SEP='' class TestPlc: default_steps = ['uninstall','install','install_rpm', - 'configure', 'start', SEP, + 'configure', 'start', 'fetch_keys', SEP, 'store_keys', 'clear_known_hosts', 'initscripts', SEP, 'sites', 'nodes', 'slices', 'nodegroups', SEP, 'init_node','bootcd', 'configure_qemu', 'export_qemu', 'kill_all_qemus', 'reinstall_node','start_node', SEP, - 'nodes_booted', 'nodes_ssh', 'check_slice', - 'check_initscripts', 'check_tcp',SEP, + 'nodes_booted', 'nodes_ssh', 'check_slice', 'check_initscripts', SEP, + 'check_sanity', 'check_tcp', 'plcsh_stress_test', SEP, 'force_gather_logs', 'force_kill_qemus', 'force_record_tracker','force_free_tracker' ] - other_steps = [ 'stop_all_vservers','fresh_install', 'cache_rpm', 'stop', SEP, - 'clean_initscripts', 'clean_sites', 'clean_nodes', + other_steps = [ 'stop_all_vservers','fresh_install', 'cache_rpm', 'stop', 'vs_start', SEP, + 'clean_initscripts', 'clean_nodegroups','clean_all_sites', SEP, + 'clean_sites', 'clean_nodes', 'clean_slices', 'clean_keys', SEP, 'show_boxes', 'list_all_qemus', 'list_qemus', SEP, 'db_dump' , 'db_restore', 'cleanup_trackers', 'cleanup_all_trackers', @@ -117,6 +118,9 @@ class TestPlc: def actual_command_in_guest (self,command): return self.test_ssh.actual_command(self.host_to_guest(command)) + def start_guest (self): + return utils.system(self.test_ssh.actual_command(self.start_guest_in_host())) + def run_in_guest (self,command): return utils.system(self.actual_command_in_guest(command)) @@ -127,6 +131,10 @@ class TestPlc: def host_to_guest(self,command): return "vserver %s exec %s"%(self.vservername,command) + #command gets run in the vserver + def start_guest_in_host(self): + return "vserver %s start"%(self.vservername) + # xxx quick n dirty def run_in_guest_piped (self,local,remote): return utils.system(local+" | "+self.test_ssh.actual_command(self.host_to_guest(remote),keep_stdin=True)) @@ -171,6 +179,37 @@ class TestPlc: return slice raise Exception,"Cannot locate slice %s"%slicename + def all_sliver_objs (self): + result=[] + for slice_spec in self.plc_spec['slices']: + slicename = slice_spec['slice_fields']['name'] + for nodename in slice_spec['nodenames']: + result.append(self.locate_sliver_obj (nodename,slicename)) + return result + + def locate_sliver_obj (self,nodename,slicename): + (site,node) = self.locate_node(nodename) + slice = self.locate_slice (slicename) + # build objects + test_site = TestSite (self, site) + test_node = TestNode (self, test_site,node) + # xxx the slice site is assumed to be the node site - mhh - probably harmless + test_slice = TestSlice (self, test_site, slice) + return TestSliver (self, test_node, test_slice) + + def locate_first_node(self): + nodename=self.plc_spec['slices'][0]['nodenames'][0] + (site,node) = self.locate_node(nodename) + test_site = TestSite (self, site) + test_node = TestNode (self, test_site,node) + return test_node + + def locate_first_sliver (self): + slice_spec=self.plc_spec['slices'][0] + slicename=slice_spec['slice_fields']['name'] + nodename=slice_spec['nodenames'][0] + return self.locate_sliver_obj(nodename,slicename) + # all different hostboxes used in this plc def gather_hostBoxes(self): # maps on sites and nodes, return [ (host_box,test_node) ] @@ -384,12 +423,16 @@ class TestPlc: def start(self): self.run_in_guest('service plc start') return True - + def stop(self): self.run_in_guest('service plc stop') return True - # could use a TestKey class + def vs_start (self): + self.start_guest() + return True + + # stores the keys from the config for further use def store_keys(self): for key_spec in self.plc_spec['keys']: TestKey(self,key_spec).store_key() @@ -398,6 +441,21 @@ class TestPlc: def clean_keys(self): 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/ + # for later direct access to the nodes + def fetch_keys(self): + dir="./keys" + if not os.path.isdir(dir): + os.mkdir(dir) + prefix = 'root_ssh_key' + vservername=self.vservername + overall=True + for ext in [ 'pub', 'rsa' ] : + src="/vservers/%(vservername)s/etc/planetlab/%(prefix)s.%(ext)s"%locals() + dst="keys/%(vservername)s.%(ext)s"%locals() + if self.test_ssh.fetch(src,dst) != 0: overall=False + return overall + def sites (self): return self.do_sites() @@ -419,6 +477,13 @@ class TestPlc: test_site.create_users() return True + def clean_all_sites (self): + 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: + print 'Deleting site_id',site_id + self.apiserver.DeleteSite(self.auth_root(),site_id) + def nodes (self): return self.do_nodes() def clean_nodes (self): @@ -441,9 +506,13 @@ class TestPlc: test_node.create_node () return True - # create nodegroups if needed, and populate - # no need for a clean_nodegroups if we are careful enough def nodegroups (self): + return self.do_nodegroups("add") + def clean_nodegroups (self): + return self.do_nodegroups("delete") + + # create nodegroups if needed, and populate + def do_nodegroups (self, action="add"): # 1st pass to scan contents groups_dict = {} for site_spec in self.plc_spec['sites']: @@ -476,7 +545,7 @@ class TestPlc: return hostnames # gracetime : during the first minutes nothing gets printed - def do_nodes_booted (self, minutes, gracetime,period=30): + def do_nodes_booted (self, minutes, gracetime,period=15): if self.options.dry_run: print 'dry_run' return True @@ -524,7 +593,7 @@ class TestPlc: def nodes_booted(self): return self.do_nodes_booted(minutes=20,gracetime=15) - def do_nodes_ssh(self,minutes,gracetime,period=30): + def do_nodes_ssh(self,minutes,gracetime,period=15): # compute timeout timeout = datetime.datetime.now()+datetime.timedelta(minutes=minutes) graceout = datetime.datetime.now()+datetime.timedelta(minutes=gracetime) @@ -573,6 +642,16 @@ class TestPlc: @node_mapper def export_qemu (self): pass + ### check sanity : invoke scripts from qaapi/qa/tests/{node,slice} + def check_sanity_node (self): + return self.locate_first_node().check_sanity() + def check_sanity_sliver (self) : + return self.locate_first_sliver().check_sanity() + + def check_sanity (self): + return self.check_sanity_node() and self.check_sanity_sliver() + + ### initscripts def do_check_initscripts(self): overall = True for slice_spec in self.plc_spec['slices']: @@ -610,6 +689,7 @@ class TestPlc: print 'deletion went wrong - probably did not exist' return True + ### manage slices def slices (self): return self.do_slices() @@ -639,24 +719,6 @@ class TestPlc: @node_mapper def start_node (self) : pass - def all_sliver_objs (self): - result=[] - for slice_spec in self.plc_spec['slices']: - slicename = slice_spec['slice_fields']['name'] - for nodename in slice_spec['nodenames']: - result.append(self.locate_sliver_obj (nodename,slicename)) - return result - - def locate_sliver_obj (self,nodename,slicename): - (site,node) = self.locate_node(nodename) - slice = self.locate_slice (slicename) - # build objects - test_site = TestSite (self, site) - test_node = TestNode (self, test_site,node) - # xxx the slice site is assumed to be the node site - mhh - probably harmless - test_slice = TestSlice (self, test_site, slice) - return TestSliver (self, test_node, test_slice) - def check_tcp (self): specs = self.plc_spec['tcp_test'] overall=True @@ -673,16 +735,30 @@ class TestPlc: if not c_test_sliver.run_tcp_client(s_test_sliver.test_node.name(),port): overall=False return overall - + + def plcsh_stress_test (self): + # install the stress-test in the plc image + location = "/usr/share/plc_api/plcsh-stress-test.py" + remote="/vservers/%s/%s"%(self.vservername,location) + self.test_ssh.copy_abs("plcsh-stress-test.py",remote) + command = location + command += " -- --check" + if self.options.small_test: + command += " --tiny" + return ( self.run_in_guest(command) == 0) def gather_logs (self): - # (1) get the plc's /var/log and store it locally in logs/myplc.var-log./* + # (1.a) get the plc's /var/log/ and store it locally in logs/myplc.var-log./* + # (1.b) get the plc's /var/lib/pgsql/data/pg_log/ -> logs/myplc.pgsql-log./* # (2) get all the nodes qemu log and store it as logs/node.qemu..log # (3) get the nodes /var/log and store is as logs/node.var-log./* # (4) as far as possible get the slice's /var/log as logs/sliver.var-log./* - # (1) + # (1.a) print "-------------------- TestPlc.gather_logs : PLC's /var/log" self.gather_var_logs () + # (1.b) + print "-------------------- TestPlc.gather_logs : PLC's /var/lib/psql/data/pg_log/" + self.gather_pgsql_logs () # (2) print "-------------------- TestPlc.gather_logs : nodes's QEMU logs" for site_spec in self.plc_spec['sites']: @@ -707,9 +783,17 @@ class TestPlc: return True def gather_var_logs (self): + utils.system("mkdir -p logs/myplc.var-log.%s"%self.name()) to_plc = self.actual_command_in_guest("tar -C /var/log/ -cf - .") command = to_plc + "| tar -C logs/myplc.var-log.%s -xf -"%self.name() - utils.system("mkdir -p logs/myplc.var-log.%s"%self.name()) + utils.system(command) + command = "chmod a+r,a+x logs/myplc.var-log.%s/httpd"%self.name() + utils.system(command) + + def gather_pgsql_logs (self): + utils.system("mkdir -p logs/myplc.pgsql-log.%s"%self.name()) + to_plc = self.actual_command_in_guest("tar -C /var/lib/pgsql/data/pg_log/ -cf - .") + command = to_plc + "| tar -C logs/myplc.pgsql-log.%s -xf -"%self.name() utils.system(command) def gather_nodes_var_logs (self): diff --git a/system/TestSlice.py b/system/TestSlice.py index 42b63b7..3ec6cb7 100644 --- a/system/TestSlice.py +++ b/system/TestSlice.py @@ -75,7 +75,7 @@ class TestSlice: found=True return (found,privatekey) - def check_slice(self,options,minutes=6,gracetime=4,period=30): + def check_slice(self,options,minutes=10,gracetime=4,period=15): timeout = datetime.datetime.now()+datetime.timedelta(minutes=minutes) graceout = datetime.datetime.now()+datetime.timedelta(minutes=gracetime) # locate a key @@ -96,8 +96,9 @@ class TestSlice: for hostname in tocheck: (site_spec,node_spec) = self.test_plc.locate_hostname(hostname) date_test_ssh = TestSsh (hostname,key=remote_privatekey,username=self.name()) + if datetime.datetime.now() >= graceout: + utils.header('Trying to enter into slice %s@%s'%(self.name(),hostname)) # this can be ran locally as we have the key - utils.header('Trying to enter into slice %s@%s'%(self.name(),hostname)) date = date_test_ssh.run("id;hostname")==0 if date: utils.header("Successfuly entered slice %s on %s"%(self.name(),hostname)) @@ -124,10 +125,7 @@ class TestSlice: for hostname in tocheck: utils.header("FAILURE to ssh into %s@%s"%(self.name(),hostname)) return False - #freezing ,slice don't get created before at least 3 minutes after sshd is started - if datetime.datetime.now() < graceout: - utils.header ("The Slice %s under the Node %s is not created yet"%(self.name(),hostname)) - time.sleep(gracetime*60) - else : time.sleep (period) + # wait for the period + time.sleep (period) # for an empty slice return True diff --git a/system/TestSliver.py b/system/TestSliver.py index 9dcda2b..f0238b3 100644 --- a/system/TestSliver.py +++ b/system/TestSliver.py @@ -23,7 +23,7 @@ class TestSliver: def create_test_ssh(self): (found,privatekey) = self.get_privateKey() if not found: - raise Exception,"Cannot find a valid key for slice %s"%self.test_slice.name() + raise Exception,"Cannot find the private key for slice %s"%self.test_slice.name() return TestSsh (self.test_node.name(),key=privatekey,username=self.test_slice.name(), # so that copies end up in the home dir buildname=".") @@ -50,3 +50,24 @@ class TestSliver: def tar_var_logs (self): return self.test_ssh.actual_command("sudo tar -C /var/log -cf - .") + def check_sanity (self): + print 'NOTE: slice sanity check scripts NOT (yet?) run in sudo' + extensions = [ 'py','pl','sh' ] + path='tests/qaapi/qa/tests/slice/' + scripts=utils.locate_sanity_scripts ('sliver '+self.name(), path,extensions) + overall = True + for script in scripts: + if not self.check_sanity_script (script): + overall = False + return overall + + def check_sanity_script (self,local_script): + ssh_handle=self.create_test_ssh() + ssh_handle.copy_home(local_script) + scriptname=os.path.basename(local_script) + if ssh_handle.run("./"+scriptname) != 0: + print "WARNING: sanity check script %s FAILED"%scriptname + # xxx - temporary : ignore result and always return true for now + #return False + return True + diff --git a/system/TestSsh.py b/system/TestSsh.py index d392659..fbaee1c 100644 --- a/system/TestSsh.py +++ b/system/TestSsh.py @@ -128,6 +128,21 @@ class TestSsh: self.buildname,os.path.basename(local_file) or ".") return utils.system(scp_command) + def copy_abs (self,local_file,remote_file,recursive=False): + if self.is_local(): + dest="" + else: + dest= "%s:"%self.hostname_part() + scp_command="scp " + scp_command += TestSsh.std_options + if recursive: scp_command += "-r " + scp_command += self.key_part() + scp_command += "%s %s%s"%(local_file,dest,remote_file) + return utils.system(scp_command) + + def copy_home (self, local_file, recursive=False): + return self.copy_abs(local_file,os.path.basename(local_file),recursive) + def fetch (self, remote_file, local_file, recursive=False): if self.is_local(): command="cp " @@ -138,8 +153,13 @@ class TestSsh: command += TestSsh.std_options if recursive: command += "-r " command += self.key_part() - command += "%s:%s/%s %s"%(self.hostname_part(),self.buildname,remote_file,local_file) - utils.system(command) + # absolute path - do not preprend buildname + if remote_file.find("/")==0: + remote_path=remote_file + else: + remote_path="%s/%s"%(self.buildname,remote_file) + command += "%s:%s %s"%(self.hostname_part(),remote_path,local_file) + return utils.system(command) # this is only to avoid harmless message when host cannot be identified # convenience only @@ -148,5 +168,5 @@ class TestSsh: def clear_known_hosts (self): known_hosts = "%s/.ssh/known_hosts"%os.getenv("HOME") utils.header("Clearing entry for %s in %s"%(self.hostname,known_hosts)) - utils.system("sed -i -e /^%s/d %s"%(self.hostname,known_hosts)) + return utils.system("sed -i -e /^%s/d %s"%(self.hostname,known_hosts)) diff --git a/system/config_1testbox.py b/system/config_1testbox.py index b804b21..aa44e7d 100644 --- a/system/config_1testbox.py +++ b/system/config_1testbox.py @@ -7,9 +7,9 @@ from TestMapper import TestMapper def config (plcs, options): if options.arch == "i386": - target = 'testbox32.one-lab.org' + target = 'testbox32.onelab.eu' elif options.arch == "x86_64": - target = 'testbox64.one-lab.org' + target = 'testbox64.onelab.eu' else: print 'Unsupported arch %s'%options.arch sys.exit(1) diff --git a/system/config_main.py b/system/config_main.py index e0236b5..2e3f3f0 100644 --- a/system/config_main.py +++ b/system/config_main.py @@ -11,7 +11,7 @@ def nodes(options): nodes= [{'name':'node1', 'node_fields': {'hostname': 'deferred01', 'model':'qemu/minhw', } , - 'host_box': 'testbox1.one-lab.org', + 'host_box': 'testbox1.onelab.eu', 'owner' : 'pi', 'network_fields': { 'method':'static', 'type':'ipv4', @@ -27,7 +27,7 @@ def nodes(options): {'name':'node2', 'node_fields': {'hostname': 'deferred02', 'model':'qemu/minhw', } , - 'host_box': 'testbox1.one-lab.org', + 'host_box': 'testbox1.onelab.eu', 'owner' : 'pi', 'network_fields': { 'method':'static', 'type':'ipv4', @@ -50,7 +50,7 @@ def all_nodenames (options): return [ node['name'] for node in nodes(options)] def users (options) : - domain="one-lab.org" + domain="onelab.eu" return [ {'name' : 'pi', 'keynames' : [ 'key1' ], 'user_fields' : {'first_name':'PI', 'last_name':'PI', 'enabled':'True', @@ -92,7 +92,7 @@ def sites (options): 'login_base':'main', 'abbreviated_name':'PLanettest', 'max_slices':100, - 'url':'http://testbox1.one-lab.org', + 'url':'http://testbox1.onelab.eu', }, 'address_fields' : {'line1':'route des lucioles', 'city':'sophia', @@ -105,7 +105,7 @@ def sites (options): }] ########## -public_key="""ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFUYyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXeWYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzVFN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO+7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bw== root@test.one-lab.org +public_key="""ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFUYyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXeWYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzVFN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO+7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bw== root@test.onelab.eu """ private_key="""-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFU @@ -225,15 +225,15 @@ def plc (options) : # 'vservername': '138.96.250.131' # 'vserverip': '138.96.250.131' 'role' : 'root', - 'PLC_ROOT_USER' : 'root@test.one-lab.org', + 'PLC_ROOT_USER' : 'root@test.onelab.eu', 'PLC_ROOT_PASSWORD' : 'test++', 'PLC_NAME' : 'TestLab', 'PLC_MAIL_ENABLED':'true', - 'PLC_MAIL_SUPPORT_ADDRESS' : 'mohamed-amine.chaoui@sophia.inria.fr', - 'PLC_DB_HOST' : 'test.one-lab.org', - 'PLC_API_HOST' : 'test.one-lab.org', - 'PLC_WWW_HOST' : 'test.one-lab.org', - 'PLC_BOOT_HOST' : 'test.one-lab.org', + 'PLC_MAIL_SUPPORT_ADDRESS' : 'thierry.parmentelat@sophia.inria.fr', + 'PLC_DB_HOST' : 'test.onelab.eu', + 'PLC_API_HOST' : 'test.onelab.eu', + 'PLC_WWW_HOST' : 'test.onelab.eu', + 'PLC_BOOT_HOST' : 'test.onelab.eu', 'PLC_NET_DNS1' : 'xxx-deferred-xxx', 'PLC_NET_DNS2' : 'xxx-deferred-xxx', 'sites' : sites(options), diff --git a/system/config_wifilab.py b/system/config_wifilab.py index 46af4df..3fe7e0d 100644 --- a/system/config_wifilab.py +++ b/system/config_wifilab.py @@ -30,7 +30,7 @@ # I'm pretty sure that yum.conf.php still needs hacking, at least for centos5 ########## unclear stuff -onelab="one-lab.org" +onelab="onelab.eu" # these are real nodes, they dont get started by the framework def nodes(): @@ -140,7 +140,7 @@ def sites (): 'login_base':'wifi', 'abbreviated_name':'wifi', 'max_slices':100, - 'url':'http://testbox1.one-lab.org', + 'url':'http://testbox1.onelab.eu', }, 'address_fields' : {'line1':'route des lucioles', 'city':'sophia', @@ -153,7 +153,7 @@ def sites (): }] ########## -public_key="""ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFUYyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXeWYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzVFN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO+7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bw== root@test.one-lab.org +public_key="""ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFUYyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXeWYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzVFN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO+7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bw== root@test.onelab.eu """ private_key="""-----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFU diff --git a/system/utils.py b/system/utils.py index d17dbef..42eb93b 100644 --- a/system/utils.py +++ b/system/utils.py @@ -1,7 +1,5 @@ # $Id$ -import time -import os -import re +import time, os, re, glob from pprint import PrettyPrinter options={} @@ -134,3 +132,10 @@ def match (string, pattern): pattern=pattern.replace("?",".") return re.compile(pattern).match(string) +def locate_sanity_scripts (message,path,extensions): + print message,'searching',path,'for extensions',extensions + scripts=[] + for ext in extensions: + scripts += glob.glob (path+'/*.'+ext) + return scripts +