Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@

robo_base_class = importlib.import_module("py-scripts.lf_base_robo")

# Directories on the real client stations where the Zoom automation scripts
# (zoom.bat, ctzoom.bash) are deployed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Narayana-CT can you please add example with dynamic directory, with option of by-default like this in arg.

WINDOWS_ZOOM_DIR = r".\local\real_application_test\zoom_automation"
LINUX_ZOOM_DIR = "./local/real_application_test/zoom_automation"
MACOS_ZOOM_DIR = "./local/real_application_test/zoom_automation"


class ZoomAutomation(Realm):
def __init__(
Expand Down Expand Up @@ -159,10 +165,16 @@ def __init__(
wait_at_point=30,
resource_ip=None,
do_roam=False,
window_dir=WINDOWS_ZOOM_DIR,
linux_dir=LINUX_ZOOM_DIR,
mac_dir=MACOS_ZOOM_DIR,
):

super().__init__(lfclient_host=lanforge_ip)
self.upstream_port = upstream_port
self.window_dir = window_dir
self.linux_dir = linux_dir
self.mac_dir = mac_dir
self.mgr_ip = lanforge_ip
self.app = Flask(__name__)
self.devices = devices
Expand Down Expand Up @@ -1124,12 +1136,13 @@ def create_host(self):
exit(0)

if self.real_sta_os_type[0] == "windows":
cmd = f"py zoom_host.py --ip {self.upstream_port}"
cmd = fr'"{self.window_dir}\zoom.bat" --ip {self.upstream_port} host'
self.generic_endps_profile.set_cmd(
self.generic_endps_profile.created_endp[0], cmd
)
elif self.real_sta_os_type[0] == "linux":
cmd = "su -l lanforge ctzoom.bash %s %s %s" % (
cmd = "su -l lanforge %s/ctzoom.bash %s %s %s" % (
self.linux_dir,
self.wifi_interface_list[0],
self.upstream_port,
"host",
Expand All @@ -1138,7 +1151,7 @@ def create_host(self):
self.generic_endps_profile.created_endp[0], cmd
)
elif self.real_sta_os_type[0] == "macos":
cmd = "sudo bash ctzoom.bash %s %s" % (self.upstream_port, "host")
cmd = "sudo bash %s/ctzoom.bash %s %s" % (self.mac_dir, self.upstream_port, "host")
self.generic_endps_profile.set_cmd(
self.generic_endps_profile.created_endp[0], cmd
)
Expand Down Expand Up @@ -1210,12 +1223,13 @@ def create_participants(self):

for i in range(1, len(self.real_sta_os_type)):
if self.real_sta_os_type[i] == "windows":
cmd = f"py zoom_client.py --ip {self.upstream_port}"
cmd = fr'"{self.window_dir}\zoom.bat" --ip {self.upstream_port} client'
self.generic_endps_profile.set_cmd(
self.generic_endps_profile.created_endp[i], cmd
)
elif self.real_sta_os_type[i] == "linux":
cmd = "su -l lanforge ctzoom.bash %s %s %s" % (
cmd = "su -l lanforge %s/ctzoom.bash %s %s %s" % (
self.linux_dir,
self.wifi_interface_list[i],
self.upstream_port,
"client",
Expand All @@ -1224,7 +1238,7 @@ def create_participants(self):
self.generic_endps_profile.created_endp[i], cmd
)
elif self.real_sta_os_type[i] == "macos":
cmd = "sudo bash ctzoom.bash %s %s" % (self.upstream_port, "client")
cmd = "sudo bash %s/ctzoom.bash %s %s" % (self.mac_dir, self.upstream_port, "client")
self.generic_endps_profile.set_cmd(
self.generic_endps_profile.created_endp[i], cmd
)
Expand Down Expand Up @@ -4413,6 +4427,26 @@ def main():
help="Specify if wanted to collect csv from dashboard. Only works with business account",
)

# arguments related to the paths of the zoom automation scripts on real client stations
parser.add_argument(
"--window_dir",
type=str,
default=WINDOWS_ZOOM_DIR,
help="Directory on Windows real client stations where zoom.bat is deployed",
)
parser.add_argument(
"--linux_dir",
type=str,
default=LINUX_ZOOM_DIR,
help="Directory on Linux real client stations where ctzoom.bash is deployed",
)
parser.add_argument(
"--mac_dir",
type=str,
default=MACOS_ZOOM_DIR,
help="Directory on macOS real client stations where ctzoom.bash is deployed",
)

# Arguments related to robo feature
robo_group = parser.add_argument_group(
"Robo Arguments", "Arguments related to robot movement and coordinates"
Expand Down Expand Up @@ -4596,10 +4630,14 @@ def main():
cycles=args.cycles,
bssids=bssids,
do_roam=args.do_roam,
window_dir=args.window_dir,
linux_dir=args.linux_dir,
mac_dir=args.mac_dir,
)
if args.download_csv:
zoom_automation.download_csv = True
args.upstream_port = zoom_automation.change_port_to_ip(args.upstream_port)
zoom_automation.upstream_port = args.upstream_port
realdevice = RealDevice(
manager_ip=args.lanforge_ip,
server_ip="192.168.1.61",
Expand Down
Loading