From f488c43c317bb309c7c2f03eacfdb31d3f6c7309 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Fri, 26 Jul 2013 16:58:12 +0200 Subject: [PATCH] Fixing test script. 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 | 6 +++++- testbeds/iotlab/tests/bash_testsuite | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/sfa/iotlab/iotlabapi.py b/sfa/iotlab/iotlabapi.py index 96d6e6d0..0e3e9008 100644 --- a/sfa/iotlab/iotlabapi.py +++ b/sfa/iotlab/iotlabapi.py @@ -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 \ diff --git a/testbeds/iotlab/tests/bash_testsuite b/testbeds/iotlab/tests/bash_testsuite index 01cec74d..8947c6ed 100755 --- a/testbeds/iotlab/tests/bash_testsuite +++ b/testbeds/iotlab/tests/bash_testsuite @@ -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" -- 2.47.0