From 91dcf543029cb7a941ac89e02a711c64b9cbc9e8 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 5 Feb 2021 14:14:31 -0800 Subject: [PATCH 1/5] sdk-set-profile: Properly compare equipment-id against string -1 Not numeric -1, since object is a string. Signed-off-by: Ben Greear --- NOLA-README.md | 1 + libs/apnos/ap_ssh.py | 3 +++ tools/sdk_set_profile.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NOLA-README.md b/NOLA-README.md index a493a3efb..8215e77ac 100644 --- a/NOLA-README.md +++ b/NOLA-README.md @@ -8,6 +8,7 @@ sudo pip3 install pandas sudo pip3 install paramiko sudo pip3 install scp sudo pip3 install pexpect +sudo pip3 install pexpect-serial # Clone these repositories to get started: git@github.com:Telecominfraproject/wlan-testing.git # This repo diff --git a/libs/apnos/ap_ssh.py b/libs/apnos/ap_ssh.py index 21f21a346..a41d77539 100755 --- a/libs/apnos/ap_ssh.py +++ b/libs/apnos/ap_ssh.py @@ -137,6 +137,9 @@ def ap_ssh_ovsh_nodec(command_line_args, key): output = str(stdout.read(), 'utf-8') + #print("ovsdh cmd: ", cmd) + #print("ovsh output: ", output) + if key != None: for line in output.splitlines(): toks = line.split(':', 1) diff --git a/tools/sdk_set_profile.py b/tools/sdk_set_profile.py index dd5ad0ef8..bcf4f5ff2 100755 --- a/tools/sdk_set_profile.py +++ b/tools/sdk_set_profile.py @@ -123,7 +123,7 @@ if equipment_id == "-1": print("Found equipment ID: %s inventoryId: %s"%(e['id'], e['inventoryId'])) equipment_id = str(e['id']) -if equipment_id == -1: +if equipment_id == "-1": print("ERROR: Could not find equipment-id.") sys.exit(1) From 3d0b1e31255facd77c4a731b3e55fcf35ccf1f17 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 5 Feb 2021 16:58:47 -0800 Subject: [PATCH 2/5] Add usage-examples notes file. Easy to cut-and-paste for common commands. --- tools/USAGE_EXAMPLES.txt | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tools/USAGE_EXAMPLES.txt diff --git a/tools/USAGE_EXAMPLES.txt b/tools/USAGE_EXAMPLES.txt new file mode 100644 index 000000000..265bd120a --- /dev/null +++ b/tools/USAGE_EXAMPLES.txt @@ -0,0 +1,52 @@ + + +All of this assumes you are running on some developer system, with ssh tunnels +into the 'ubuntu' jumphost machine. + +ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \ + -L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \ + -L 8890:lf9:4002 -L 8891:lf9:5901 -L 8892:lf9:8080 -L 8893:lab-ctlr3:22 \ + -L 8900:lf10:4002 -L 8901:lf10:5901 -L 8902:lf10:8080 -L 8903:lab-ctlr3:22 \ + -L 8820:lf12:4002 -L 8821:lf12:5901 -L 8822:lf12:8080 -L 8823:lab-ctlr4:22 \ + ubuntu@orch + +The ports are used as: + 4002: LANforge GUI connection to LANforge in the testbed. + 5901: VNC connection to LANforge machine. + 8080: LANforge JSON/API connection. + 22: ssh shell access to lab controller + + Each testbed will have a set of 4 ssh tunnels. Some are duplicated since + lab-controllers are shared. I figure a consistent pattern is worth a few + duplicated tunnels. + + + +Testbed-09 (perfecto) + +# Set AP profile (ssid, etc) on 'b' chamber. AP is ttyAP4 +./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ + --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 \ + --lanforge-ip-address localhost --lanforge-port-number 8892 \ + --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ + --skip-radius --skip-wpa --verbose --testbed "NOLA-09b" \ + --ssid-5g-wpa2 Default-SSID-5gl-perfecto-b --psk-5g-wpa2 12345678 \ + --ssid-2g-wpa2 Default-SSID-2g-perfecto-b --psk-2g-wpa2 12345678 + +# Set AP profile (ssid, etc) on 'a' chamber. AP is ttyAP1 +./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ + --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 \ + --lanforge-ip-address localhost --lanforge-port-number 8892 \ + --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ + --skip-radius --skip-wpa --verbose --testbed "NOLA-09a" \ + --ssid-5g-wpa2 Default-SSID-5gl-perfecto --psk-5g-wpa2 12345678 \ + --ssid-2g-wpa2 Default-SSID-2g-perfecto --psk-2g-wpa2 12345678 + + +Testbed 10 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenuator, etc) + +./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8903 \ + --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP2 --lanforge-ip-address localhost --lanforge-port-number 8902 \ + --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ + --skip-radius --skip-wpa --verbose --testbed "NOLA-10" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ + --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 From 24cd9219a453e1c52344c9125eb830af463695ff Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 5 Feb 2021 14:14:31 -0800 Subject: [PATCH 3/5] sdk-set-profile: Properly compare equipment-id against string -1 Not numeric -1, since object is a string. Signed-off-by: Ben Greear --- NOLA-README.md | 1 + libs/apnos/ap_ssh.py | 3 +++ tools/sdk_set_profile.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NOLA-README.md b/NOLA-README.md index a493a3efb..8215e77ac 100644 --- a/NOLA-README.md +++ b/NOLA-README.md @@ -8,6 +8,7 @@ sudo pip3 install pandas sudo pip3 install paramiko sudo pip3 install scp sudo pip3 install pexpect +sudo pip3 install pexpect-serial # Clone these repositories to get started: git@github.com:Telecominfraproject/wlan-testing.git # This repo diff --git a/libs/apnos/ap_ssh.py b/libs/apnos/ap_ssh.py index 21f21a346..a41d77539 100755 --- a/libs/apnos/ap_ssh.py +++ b/libs/apnos/ap_ssh.py @@ -137,6 +137,9 @@ def ap_ssh_ovsh_nodec(command_line_args, key): output = str(stdout.read(), 'utf-8') + #print("ovsdh cmd: ", cmd) + #print("ovsh output: ", output) + if key != None: for line in output.splitlines(): toks = line.split(':', 1) diff --git a/tools/sdk_set_profile.py b/tools/sdk_set_profile.py index dd5ad0ef8..bcf4f5ff2 100755 --- a/tools/sdk_set_profile.py +++ b/tools/sdk_set_profile.py @@ -123,7 +123,7 @@ if equipment_id == "-1": print("Found equipment ID: %s inventoryId: %s"%(e['id'], e['inventoryId'])) equipment_id = str(e['id']) -if equipment_id == -1: +if equipment_id == "-1": print("ERROR: Could not find equipment-id.") sys.exit(1) From 2b05bfb7c0f06dae175522fd686b8329a842dc38 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Fri, 5 Feb 2021 16:58:47 -0800 Subject: [PATCH 4/5] Add usage-examples notes file. Easy to cut-and-paste for common commands. --- tools/USAGE_EXAMPLES.txt | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tools/USAGE_EXAMPLES.txt diff --git a/tools/USAGE_EXAMPLES.txt b/tools/USAGE_EXAMPLES.txt new file mode 100644 index 000000000..265bd120a --- /dev/null +++ b/tools/USAGE_EXAMPLES.txt @@ -0,0 +1,52 @@ + + +All of this assumes you are running on some developer system, with ssh tunnels +into the 'ubuntu' jumphost machine. + +ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \ + -L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \ + -L 8890:lf9:4002 -L 8891:lf9:5901 -L 8892:lf9:8080 -L 8893:lab-ctlr3:22 \ + -L 8900:lf10:4002 -L 8901:lf10:5901 -L 8902:lf10:8080 -L 8903:lab-ctlr3:22 \ + -L 8820:lf12:4002 -L 8821:lf12:5901 -L 8822:lf12:8080 -L 8823:lab-ctlr4:22 \ + ubuntu@orch + +The ports are used as: + 4002: LANforge GUI connection to LANforge in the testbed. + 5901: VNC connection to LANforge machine. + 8080: LANforge JSON/API connection. + 22: ssh shell access to lab controller + + Each testbed will have a set of 4 ssh tunnels. Some are duplicated since + lab-controllers are shared. I figure a consistent pattern is worth a few + duplicated tunnels. + + + +Testbed-09 (perfecto) + +# Set AP profile (ssid, etc) on 'b' chamber. AP is ttyAP4 +./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ + --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 \ + --lanforge-ip-address localhost --lanforge-port-number 8892 \ + --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ + --skip-radius --skip-wpa --verbose --testbed "NOLA-09b" \ + --ssid-5g-wpa2 Default-SSID-5gl-perfecto-b --psk-5g-wpa2 12345678 \ + --ssid-2g-wpa2 Default-SSID-2g-perfecto-b --psk-2g-wpa2 12345678 + +# Set AP profile (ssid, etc) on 'a' chamber. AP is ttyAP1 +./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ + --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 \ + --lanforge-ip-address localhost --lanforge-port-number 8892 \ + --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ + --skip-radius --skip-wpa --verbose --testbed "NOLA-09a" \ + --ssid-5g-wpa2 Default-SSID-5gl-perfecto --psk-5g-wpa2 12345678 \ + --ssid-2g-wpa2 Default-SSID-2g-perfecto --psk-2g-wpa2 12345678 + + +Testbed 10 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenuator, etc) + +./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8903 \ + --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP2 --lanforge-ip-address localhost --lanforge-port-number 8902 \ + --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ + --skip-radius --skip-wpa --verbose --testbed "NOLA-10" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ + --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 From 9fac5990b47095ed4814df78170c47d185a2541f Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Mon, 8 Feb 2021 16:20:10 -0800 Subject: [PATCH 5/5] tools: Add examples for NOLA-11 testbed. It is now functional, though it appears eap102 is broken when managed by cloud at the moment. Add support for eap102 model to base cmd-line arg parser. Signed-off-by: Ben Greear --- tests/UnitTestBase.py | 2 +- tools/USAGE_EXAMPLES.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/UnitTestBase.py b/tests/UnitTestBase.py index 9bf292b07..34d044336 100644 --- a/tests/UnitTestBase.py +++ b/tests/UnitTestBase.py @@ -98,7 +98,7 @@ class UnitTestBase: default = False) self.parser.add_argument("--force-upgrade", type=bool, help="Force upgrading firmware even if it is already current version", default = False) - self.parser.add_argument("-m", "--model", type=str, choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', 'wf188n', 'None'], + self.parser.add_argument("-m", "--model", type=str, choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', 'wf188n', 'eap102', 'None'], help="AP model to be run", required=True) self.parser.add_argument("--equipment_id", type=str, help="AP model ID, as exists in the cloud-sdk. -1 to auto-detect.", diff --git a/tools/USAGE_EXAMPLES.txt b/tools/USAGE_EXAMPLES.txt index 265bd120a..284d79d2c 100644 --- a/tools/USAGE_EXAMPLES.txt +++ b/tools/USAGE_EXAMPLES.txt @@ -7,6 +7,7 @@ ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \ -L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \ -L 8890:lf9:4002 -L 8891:lf9:5901 -L 8892:lf9:8080 -L 8893:lab-ctlr3:22 \ -L 8900:lf10:4002 -L 8901:lf10:5901 -L 8902:lf10:8080 -L 8903:lab-ctlr3:22 \ + -L 8910:lf11:4002 -L 8911:lf11:5901 -L 8912:lf11:8080 -L 8913:lab-ctlr3:22 \ -L 8820:lf12:4002 -L 8821:lf12:5901 -L 8822:lf12:8080 -L 8823:lab-ctlr4:22 \ ubuntu@orch @@ -50,3 +51,11 @@ Testbed 10 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenua --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ --skip-radius --skip-wpa --verbose --testbed "NOLA-10" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 + +Testbed 11 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenuator, etc) + +./sdk_set_profile.py --testrail-user-id NONE --model eap102 --ap-jumphost-address localhost --ap-jumphost-port 8913 \ + --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP3 --lanforge-ip-address localhost --lanforge-port-number 8912 \ + --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ + --skip-radius --skip-wpa --verbose --testbed "NOLA-11" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ + --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678