[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lnst-developers
Subject:    [lnst] TestTCPConnect: option parsing bug fixes
From:       Jiří Pírko <jirka () fedoraproject ! org>
Date:       2013-02-08 12:12:23
Message-ID: 20130208121224.922392426 () fedorahosted ! org
[Download RAW message or body]

commit bbb4c0315c239be3ffb70e479dabeaead6c6d70a
Author: Ondrej Lichtner <olichtne@redhat.com>
Date:   Fri Feb 8 11:09:47 2013 +0100

    TestTCPConnect: option parsing bug fixes
    
    This commit fixes two bugs during option parsing:
    
    * option "sleep" is not mandatory but when not specified the module
    * crashes
    
    * option "port" needs to be an integer value, and the function extend
    * was used on the port list, splitting the port string into individual
    * characters
    
    Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>

 test_modules/TestTCPConnect.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/test_modules/TestTCPConnect.py b/test_modules/TestTCPConnect.py
index 4a5dc5c..4da2600 100644
--- a/test_modules/TestTCPConnect.py
+++ b/test_modules/TestTCPConnect.py
@@ -123,7 +123,7 @@ class TestTCPConnect(TestGeneric):
         # either port or port_range should be set
         port = self.get_opt("port")
         if port:
-            self._port = port
+            self._port = int(port)
         else:
             port_range = self.get_opt("port_range")
             if port_range:
@@ -132,9 +132,11 @@ class TestTCPConnect(TestGeneric):
                 e = TestOptionMissing()
                 raise e
 
-        sleep_time = float(self.get_opt("sleep"))
+        sleep_time = self.get_opt("sleep")
         if sleep_time:
-            self._sleep_time = sleep_time
+            self._sleep_time = float(sleep_time)
+        else:
+            self._sleep_time = 0
 
         cont = self.get_opt("cont")
         if cont:
@@ -177,7 +179,7 @@ class TestTCPConnect(TestGeneric):
 
         ports = []
         if self._port:
-            ports.extend(self._port)
+            ports.append(self._port)
         else:
             r = self.parse_port_range()
             ports.extend(r)
_______________________________________________
LNST-developers mailing list
LNST-developers@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic