From: Thierry Parmentelat Date: Tue, 6 May 2008 16:48:05 +0000 (+0000) Subject: testslice knows about 'vref' X-Git-Tag: tests-4.2-4~23 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0624e57024b81944ff321677f8c22e83f2433241;p=tests.git testslice knows about 'vref' vtest-init-vserver now sets hostname wifilab config tuned for multi-arch multi-vref testing --- diff --git a/system/TestPlc.py b/system/TestPlc.py index 6cb90ba..1c3cb7c 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -5,6 +5,7 @@ import time import sys import traceback from types import StringTypes +import socket import utils from TestSite import TestSite @@ -295,11 +296,18 @@ class TestPlc: for level in [ 'arch' ]: repo_url = os.path.dirname(repo_url) if self.options.arch == "i386": - personality="-p linux32" + personality_option="-p linux32" else: - personality="-p linux64" - create_vserver="%s/vtest-init-vserver.sh %s %s %s -- --interface eth0:%s"%\ - (build_dir,personality,self.vservername,repo_url,self.vserverip) + personality_option="-p linux64" + script="vtest-init-vserver.sh" + vserver_name = self.vservername + vserver_options="--netdev eth0 --interface %s"%self.vserverip + try: + vserver_hostname=socket.gethostbyaddr(self.vserverip)[0] + vserver_options += " --hostname %s"%vserver_hostname + except: + pass + create_vserver="%(build_dir)s/%(script)s %(personality_option)s %(vserver_name)s %(repo_url)s -- %(vserver_options)s"%locals() return self.run_in_host(create_vserver) == 0 ### install_rpm diff --git a/system/TestSlice.py b/system/TestSlice.py index 1305618..41e5146 100644 --- a/system/TestSlice.py +++ b/system/TestSlice.py @@ -56,6 +56,9 @@ class TestSlice: isname=self.slice_spec['initscriptname'] utils.header("Adding initscript %s in %s"%(isname,slice_name)) self.test_plc.apiserver.AddSliceAttribute(self.test_plc.auth_root(), slice_name,'initscript',isname) + if self.slice_spec.has_key ('vref'): + vref_value=self.slice_spec['vref'] + self.test_plc.apiserver.AddSliceAttribute(self.test_plc.auth_root(), slice_name,'vref',vref_value) def locate_key(self): # locate the first avail. key diff --git a/system/config_wifilab.py b/system/config_wifilab.py index ba94866..b73b0e3 100644 --- a/system/config_wifilab.py +++ b/system/config_wifilab.py @@ -5,9 +5,34 @@ # (**) TestMain options field # (*) and that returns the new set of plc_specs +# archs & vrefs : +# current focus is to +########## myplc +# (*) run a 32bits myplc +########## multi-arch +# (*) run wlab02 as a plain 32bits node +# (*) try and run 64bits in wlab17 (i.e. bootcd & bootstrapfs) +# which should be achieved by simply adding this node in the 'x86_64' nodegroup +# (*) investigate what it takes to have the slivers on wlab17 run 32bits as well +########## multi-vref +# (*) define slice 'plain' without secific tuning, that should result in f8-based slivers +# (*) define slice 'centos' with its vref set to centos5 +########## manual stuff +# all this would require to +# (*) install bootcd f8-x86_64 +# (*) install bootstrapfs f8-x86_64 +# (*) install noderepo f8-x86_64 +# (*) install noderepo centos5-i386 +# (*) install noderepo centos5-x86_64 +# (*) install vserver centos5-i386 +# (*) and add that to yumgroups.xml +########## unclear stuff +# I'm pretty sure that yum.conf.php still needs hacking, at least for centos5 +########## unclear stuff + onelab="one-lab.org" -# use a model that contains "vmware" to get the node actually started +# these are real nodes, they dont get started by the framework def nodes(): node02 = {'name':'wlab02', 'node_fields': {'hostname': 'wlab02.inria.fr', 'model':'Dell Latitude 830'}, @@ -23,6 +48,20 @@ def nodes(): }, ], } + node17 = {'name':'wlab17', + 'node_fields': {'hostname': 'wlab17.inria.fr', 'model':'Dell Latitude 830'}, + 'owner' : 'pi', + 'nodegroups' : ['wifi','x86_64'] , + 'network_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.177',}, + 'extra_interfaces' : [ { 'network_fields' : { 'method' : 'dhcp', + 'type' : 'ipv4', + 'mac' : '00:1c:bf:51:3c:19', + 'ip' : '138.96.250.207',}, + 'settings' : { 'essid' : 'guest-inria-sophia', + 'ifname' : 'wlan0',}, + }, + ], + } node05 = {'name':'wlab05', 'node_fields': {'hostname': 'wlab05.inria.fr', 'model':'Dell Latitude 830'}, 'owner' : 'pi', @@ -51,22 +90,10 @@ def nodes(): }, ], } - node17 = {'name':'wlab17', - 'node_fields': {'hostname': 'wlab17.inria.fr', 'model':'Dell Latitude 830'}, - 'owner' : 'pi', - 'nodegroups' : ['wifi','x86_64'] , - 'network_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.177',}, - 'extra_interfaces' : [ { 'network_fields' : { 'method' : 'dhcp', - 'type' : 'ipv4', - 'mac' : '00:1c:bf:51:3c:19', - 'ip' : '138.96.250.207',}, - 'settings' : { 'essid' : 'guest-inria-sophia', - 'ifname' : 'wlan0',}, - }, - ], - } - return [ node02 , node05 , node17 ] + + # wlab05 not avail. for now + return [ node02 , node17 ] def all_nodenames (): return [ node['name'] for node in nodes()] @@ -166,28 +193,41 @@ def keys (): def initscripts(): return [ { 'initscript_fields' : { 'enabled' : True, - 'name':'script1', - 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 1; date) > /tmp/initscript1.log \n ', + 'name':'script_plain', + 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 1; date) > /tmp/initscript_plain.log \n ', }}, { 'initscript_fields' : { 'enabled' : True, - 'name':'script2', - 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 2; date) > /tmp/initscript2.log \n ', + 'name':'script_centos', + 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 2; date) > /tmp/initscript_centos.log \n ', }}, ] def slices (): - return [ { 'slice_fields': {'name':'wifi_slice1', + plain= { 'slice_fields': {'name':'wifi_plain', + 'instantiation':'plc-instantiated', + 'url':'http://foo@foo.com', + 'description':'plain slice', + 'max_nodes':10, + }, + 'usernames' : [ 'pi','tech','techuser' ], + 'nodenames' : all_nodenames(), + 'initscriptname' : 'script_plain', + 'sitename' : 'wifi', + 'owner' : 'pi', + } + centos= { 'slice_fields': {'name':'wifi_centos', 'instantiation':'plc-instantiated', 'url':'http://foo@foo.com', - 'description':'test slice', - 'max_nodes':2 + 'description':'centos slice', + 'max_nodes':10, }, 'usernames' : [ 'pi','tech','techuser' ], 'nodenames' : all_nodenames(), - 'initscriptname' : 'script1', + 'initscriptname' : 'script_centos', 'sitename' : 'wifi', 'owner' : 'pi', - }, + 'vref' : 'centos5', + } ] def plc () :