test: Correctly check number of test script arguments
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 13 Sep 2012 08:32:05 +0000 (11:32 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 13 Sep 2012 10:44:17 +0000 (13:44 +0300)
len(sys.argv) gives the number of arguments including the
name of the command.

Fixes BMC#25722

test/enable-tethering

index c9668a1..cbcd4e7 100755 (executable)
@@ -3,7 +3,7 @@
 import sys
 import dbus
 
-if (len(sys.argv) >= 2 and len(sys.argv) < 4 and sys.argv[1] == "wifi"):
+if (len(sys.argv) >= 3 and len(sys.argv) != 4 and sys.argv[1] == "wifi"):
        print "Usage: %s wifi [SSID] [passphrase]" % (sys.argv[0])
        sys.exit(1)
 elif (len(sys.argv) < 2):