cv report ssh port and local path added, cv manager report name variable added

Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
shivamcandela
2021-05-31 23:27:38 +05:30
parent eb79a0f3e6
commit 3c76df8d41
3 changed files with 12 additions and 5 deletions

View File

@@ -72,6 +72,7 @@ class cv_test(Realm):
super().__init__(lfclient_host=lfclient_host,
lfclient_port=lfclient_port)
self.report_dir = report_dir
self.report_name = None
# Add a config line to a text blob. Will create new text blob
# if none exists already.
@@ -366,7 +367,7 @@ class cv_test(Realm):
break
time.sleep(1)
self.report_name = self.get_report_location(instance_name)
# Ensure test is closed and cleaned up
self.delete_instance(instance_name)

View File

@@ -3,12 +3,15 @@ from scp import SCPClient
class lanforge_reports:
def pull_reports(self,hostname="localhost", username="lanforge", password="lanforge", report_location="/home/lanforge/html-reports/"):
def pull_reports(self, hostname="localhost", port=22, username="lanforge", password="lanforge",
report_location="/home/lanforge/html-reports/",
local_path="../../../reports/"):
ssh = paramiko.SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=hostname, username=username, password=password, allow_agent=False, look_for_keys=False)
ssh.connect(hostname=hostname, username=username, password=password, port=port)
with SCPClient(ssh.get_transport()) as scp:
scp.get(report_location,recursive=True)
scp.get(remote_path=report_location, local_path=local_path, recursive=True)
scp.close()

View File

@@ -120,6 +120,8 @@ class DataplaneTest(cv_test):
lf_port=8080,
lf_user="lanforge",
lf_password="lanforge",
ssh_port=22,
local_path="",
instance_name="dpt_instance",
config_name="dpt_config",
upstream="1.1.eth2",
@@ -205,7 +207,8 @@ class DataplaneTest(cv_test):
self.create_and_run_test(self.load_old_cfg, self.test_name, self.instance_name,
self.config_name, self.sets,
self.pull_report, self.lf_host, self.lf_user, self.lf_password,
cv_cmds, graph_groups_file=self.graph_groups)
cv_cmds, ssh_port=self.ssh_port, local_path=self.local_path,
graph_groups_file=self.graph_groups)
self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name