Fixing test script.
authorSandrine Avakian <sandrine.avakian@inria.fr>
Fri, 26 Jul 2013 14:58:12 +0000 (16:58 +0200)
committerSandrine Avakian <sandrine.avakian@inria.fr>
Fri, 26 Jul 2013 14:58:12 +0000 (16:58 +0200)
Fixing yet another problem with GetSlices (slice returned is empty
if of all the current leases none belong tto the slice we are looking
for).

sfa/iotlab/iotlabapi.py
testbeds/iotlab/tests/bash_testsuite

index 96d6e6d..0e3e900 100644 (file)
@@ -1298,9 +1298,13 @@ class IotlabTestbedAPI():
             if leases_list == [] and fixed_slicerec_dict:
                 return_slicerec_dictlist.append(fixed_slicerec_dict)
 
+            # if the jobs running don't belong to the user/slice we are looking
+            # for
+            leases_hrn = [lease['slice_hrn'] for lease in leases_list]
+            if slice_hrn not in leases_hrn:
+                return_slicerec_dictlist.append(fixed_slicerec_dict)
             #If several jobs for one slice , put the slice record into
             # each lease information dict
-
             for lease in leases_list:
                 slicerec_dict = {}
                 logger.debug("IOTLABDRIVER.PY  \tGetSlices slice_filter %s   \
index 01cec74..8947c6e 100755 (executable)
@@ -8,33 +8,35 @@ os.system('sfi.py list iotlab')
 
 
 print " =================    SFI.PY RESOURCES          ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py resources')
 
+
 print " ================= SFI.PY RESOURCES -R IOTLAB        ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py resources -r iotlab')
 
+
 print " =================    SFI.PY RESOURCES -L ALL      ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py resources -l all')
 
 print " ================= SFI.PY RESOURCES -R IOTLAB -L ALL ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py resources -r iotlab -l all')
 
-print " ================= SFI.PY RESOURCES -L ALL > avakian_adv.rspec ==========="
-os.system('sfi.py resources -l all > /root/tests_rspecs/iotlab_devlille_OUTPUT.rspec')
+print " ================= SFI.PY RESOURCES -O  output rspec ==========="
+os.system('sfi.py resources -o /root/tests_rspecs/iotlab_devlille_OUTPUT.rspec')
 
 print " ================= SFI.PY RESOURCES -L LEASES  ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py resources -l leases')
 
 print " =================SFI.PY RESOURCES -L LEASES -R IOTLAB ============== "
 os.system('sfi.py resources -r iotlab -l leases')
 
 print " ================= SFI.PY RESOURCES avakian_adv.rspec ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py resources iotlab.avakian_slice')
 
 
@@ -42,26 +44,26 @@ print " =================    SFI.PY SHOW SLICE   ============="
 os.system('sfi.py show iotlab.avakian_slice')
 
 print " =================    SFI.PY SHOW USER   ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py show iotlab.avakian')
 
 print " =================    SFI.PY SHOW NODE   ============="
 os.system('sfi.py show iotlab.node6.devlille.senslab.info')
 
 print " =================    SFI.PY SLICES       ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py slices')
 
 print " =================    SFI.PY STATUS SLICE   ============="
 os.system('sfi.py status iotlab.avakian_slice')
 
 print " =================    SFI.PY CREATE SLICE   ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py create iotlab.avakian_slice /root/tests_rspecs/iotlab_devlille.rspec')
 
 
 print " =================    SFI.PY DELETE SLICE   ============="
-input("Press Enter to continue...")
+raw_input("Press Enter to continue...")
 os.system('sfi.py delete iotlab.avakian_slice')
 print "\r\n"