From 117bf61795f4db5c6ddb7bf33fd4d55cf82003d6 Mon Sep 17 00:00:00 2001 From: jitendracandela <78074038+jitendracandela@users.noreply.github.com> Date: Tue, 21 Jun 2022 09:52:39 +0530 Subject: [PATCH] Wifi 9648 (#624) * Added print statement Signed-off-by: jitendracandela * Fixed dfs issue for wifi-5 AP's Signed-off-by: jitendracandela --- libs/apnos/apnos.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py index 67fdf83a2..c521cbe43 100644 --- a/libs/apnos/apnos.py +++ b/libs/apnos/apnos.py @@ -619,18 +619,22 @@ class APNOS: def dfs(self): if self.type.lower() == "wifi5": - #cmd = "cd /sys/kernel/debug/ieee80211/phy1/ath10k/ && echo 1 > dfs_simulate_radar" - #print("cmd: ", cmd) + client = self.ssh_cli_connect() + cmd1 = '[ -f /sys/kernel/debug/ieee80211/phy1/ath10k/dfs_simulate_radar ] && echo "True" || echo "False"' if self.mode: - client = self.ssh_cli_connect() - cmd1 = '[ -f /sys/kernel/debug/ieee80211/phy1/ath10k/dfs_simulate_radar ] && echo "True" || echo "False"' - stdin, stdout, stderr = client.exec_command(cmd1) - output = str(stdout.read()) - if output.__contains__("False"): - cmd = "cd /sys/kernel/debug/ieee80211/phy0/ath10k/ && echo 1 > dfs_simulate_radar" - else: - cmd = "cd /sys/kernel/debug/ieee80211/phy1/ath10k/ && echo 1 > dfs_simulate_radar" + cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd1}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read() + status = output.decode('utf-8') + status_count = int(status.count("True")) + print("status", status) + print("count", status_count) client.close() + if status_count == 1: + cmd = "cd && cd /sys/kernel/debug/ieee80211/phy0/ath10k/ && echo 1 > dfs_simulate_radar" + else: + cmd = "cd && cd /sys/kernel/debug/ieee80211/phy1/ath10k/ && echo 1 > dfs_simulate_radar" command = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ f"cmd --value \"{cmd}\" " elif self.type.lower() == "wifi6" or self.type.lower() == "wifi6e":