test PLC_VSYS_DEFAULTS
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 18 Dec 2012 08:33:20 +0000 (09:33 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 18 Dec 2012 08:33:20 +0000 (09:33 +0100)
system/TestApiserver.py
system/TestPlc.py
system/TestSlice.py
system/config_default.py

index e453739..ea85300 100644 (file)
@@ -50,6 +50,7 @@ server_methods = [ ('GetNodes' ,  []),
                    ('GetLeases', []),
                    ('DeleteLeases',True),
                    ('AddConfFile','True'),
+                   ('GetSliceTags',[]),
                    ('system.listMethods',[]),
                    ]
 
index 2e9d009..1352477 100644 (file)
@@ -94,7 +94,7 @@ class TestPlc:
         'sfi_list@1', 'sfi_show@1', 'sfi_slices@1', 'sfa_utest@1', SEPSFA,
         # we used to run plcsh_stress_test, and then ssh_node_debug and ssh_node_boot
         # but as the stress test might take a while, we sometimes missed the debug mode..
-        'ssh_node_debug@1', 'plcsh_stress_test@1', SEP,
+        'check_vsys_defaults', 'ssh_node_debug@1', 'plcsh_stress_test@1', SEP,
         'ssh_node_boot@1', 'ssh_slice', 'check_initscripts', SEP,
         'ssh_slice_sfa@1', 'sfa_delete_slice@1', 'sfa_delete_user@1', SEPSFA,
         'cross_check_tcp@1', 'check_system_slice', SEP,
@@ -639,6 +639,7 @@ class TestPlc:
                      'PLC_RESERVATION_GRANULARITY',
                      'PLC_OMF_ENABLED',
                      'PLC_OMF_XMPP_SERVER',
+                     'PLC_VSYS_DEFAULTS',
                      ]:
             fileconf.write ('e %s\n%s\n'%(var,self.plc_spec[var]))
         fileconf.write('w\n')
@@ -1129,6 +1130,9 @@ class TestPlc:
     @slice_mapper
     def ssh_slice_off (self): pass
 
+    @slice_mapper
+    def check_vsys_defaults(self): pass
+
     @node_mapper
     def keys_clear_known_hosts (self): pass
     
index f062884..8cb3aab 100644 (file)
@@ -60,6 +60,16 @@ class TestSlice:
 
         self.add_nodes()
 
+    def check_vsys_defaults (self, options, *args, **kwds):
+        "check vsys tags match PLC_VSYS_DEFAULTS"
+        auth = self.owner_auth()
+        slice_fields = self.slice_spec['slice_fields']
+        slice_name = slice_fields['name']
+        vsys_tags = self.test_plc.apiserver.GetSliceTags (auth,{'tagname':'vsys','name':slice_name})
+        values=[ st['value'] for st in vsys_tags ]
+        expected=self.test_plc.plc_spec['expected_vsys_tags']
+        return set(values) == set(expected)
+
     # just add the nodes and handle tags
     def add_nodes (self):
         auth = self.owner_auth()
index d7de172..5dbea75 100644 (file)
@@ -484,6 +484,8 @@ def plc (options,index) :
         'PLC_NET_DNS1' : 'deferred-dns-1',
         'PLC_NET_DNS2' : 'deferred-dns-2',
         'PLC_RESERVATION_GRANULARITY':1800,
+        'PLC_VSYS_DEFAULTS':' , vif_up, vif_down, fd_tuntap, promisc, ',
+        'expected_vsys_tags': [ 'vif_up', 'vif_down', 'fd_tuntap', 'promisc', ],
         # minimal config so the omf plugins actually trigger
         'PLC_OMF_ENABLED' : 'true',
         'PLC_OMF_XMPP_SERVER': 'deferred-myplc-hostname',