Esempio n. 1
0
 def __sync_usr_global_nsg(self):
     pkg_path_ncpe = self.pkg_path + '/ncpe'
     cmdstr = 'mkdir -p ' + pkg_path_ncpe
     cmd = cmdstr.split()
     shell.execute_hdr("Creating directory " + pkg_path_ncpe, cmd)
     pkg_path_ncpe_i = self.pkg_path + '/ncpe-i'
     cmdstr = 'mkdir -p ' + pkg_path_ncpe_i
     cmd = cmdstr.split()
     shell.execute_hdr("Creating directory " + pkg_path_ncpe_i, cmd)
     for file in self.ncpe_files:
         src_path = self.vrs_local_path + '/' + file
         if os.path.exists(src_path) == False:
             continue
         if (file.find("qcow2") != -1):
             dst_path = pkg_path_ncpe
             cmdstr = 'scp ' + src_path + ' ' + self.usr_global_machine + ':' + dst_path
             cmd = cmdstr.split()
             shell.execute_hdr("Sync " + src_path + " to " + dst_path, cmd)
             dst_path = pkg_path_ncpe_i
             cmdstr = 'scp ' + src_path + ' ' + self.usr_global_machine + ':' + dst_path
             cmd = cmdstr.split()
             shell.execute_hdr("Sync " + src_path + " to " + dst_path, cmd)
             continue
         if (file.find("USE") != -1):
             dst_path = pkg_path_ncpe_i
         else:
             dst_path = pkg_path_ncpe
         cmdstr = 'scp ' + src_path + ' ' + self.usr_global_machine + ':' + dst_path
         cmd = cmdstr.split()
         shell.execute_hdr("Sync " + src_path + " to " + dst_path, cmd)
Esempio n. 2
0
 def __show_dhcp_evpn_appctl(self, evpn_id, dhcp_cmd_hdr, dhcp_cmd,
                             need_br):
     if (need_br == True):
         cmd = [self.appctl_path, "evpn/" + dhcp_cmd, self.br, evpn_id]
     else:
         cmd = [self.appctl_path, "evpn/" + dhcp_cmd, evpn_id]
     shell.execute_hdr(dhcp_cmd_hdr + ":", cmd)
Esempio n. 3
0
	def show(self, evpn_id):
		if (evpn_id == None) or (evpn_id == ""):
			cmd = [ self.appctl_path, "evpn/show", self.br ]
			header = "EVPN configuration:"
		else:
			cmd = [ self.appctl_path, "evpn/show", self.br, str(evpn_id) ]
			header = "EVPN configuration for evpn_id " + str(evpn_id) + ":"
		shell.execute_hdr(header, cmd)
Esempio n. 4
0
 def show(self, vrf_id):
     if (vrf_id == None) or (vrf_id == ""):
         cmd = [self.appctl_path, "vrf/show", self.br]
         header = "VRF configuration:"
     else:
         cmd = [self.appctl_path, "vrf/show", self.br, str(vrf_id)]
         header = "VRF configuration for vrf_id " + str(vrf_id) + ":"
     shell.execute_hdr(header, cmd)
Esempio n. 5
0
 def __sync_usr_global_el7(self):
     pkg_path_el7 = self.pkg_path + "/el7"
     cmdstr = 'mkdir -p ' + pkg_path_el7
     cmd = cmdstr.split()
     shell.execute_hdr("Creating directory " + pkg_path_el7, cmd)
     for path, dirs, files in os.walk(self.vrs_local_path):
         for f in files:
             src_path = os.path.join(path, f)
             if os.path.exists(src_path) == False:
                 continue
             dst_path = pkg_path_el7
             cmdstr = 'scp ' + src_path + ' ' + self.usr_global_machine + ':' + dst_path
             cmd = cmdstr.split()
             shell.execute_hdr("Sync " + src_path + " to " + dst_path, cmd)
Esempio n. 6
0
	def show(self):
		cmd = [ self.appctl_path, "dpif/show", ]
		shell.execute_hdr("DPIF configuration", cmd)

		cmd = [ self.ofctl_path, "dump-ports-desc", self.br ]
		shell.execute_hdr("OFProto configuration", cmd)

		cmd = [ self.appctl_path, "bridge/port-show" ]
		shell.execute_hdr("Bridge Port configuration", cmd)
Esempio n. 7
0
 def exec__(self, cmdstr):
     self.__sync_usr_global()
     cmd = cmdstr.split()
     shell.execute_hdr("Running regression cmd", cmd)
Esempio n. 8
0
	def dump_flows(self):
		if (self.uuid != None) and (self.uuid != ""):
			cmd = [ self.appctl_path, "vm/dump-flows", self.uuid ]
		else:
			cmd = [ self.appctl_path, "vm/dump-flows" ]
		shell.execute_hdr("VM " + self.name + " dump-flows", cmd)
Esempio n. 9
0
	def show(self):
		if (self.uuid != None) and (self.uuid != ""):
			cmd = [ self.appctl_path, "vm/port-show", self.uuid ]
		else:
			cmd = [ self.appctl_path, "vm/port-show" ]
		shell.execute_hdr("VM " + self.name + " port-show", cmd)
Esempio n. 10
0
 def dump_flows(self):
     cmd = [self.appctl_path, "bridge/dump-flows", self.br]
     shell.execute_hdr("Displaying flows in " + self.br, cmd)