Merge "WIP: Cirros TestVM: Allow config of username/password"
authorJose Lausuch <jose.lausuch@ericsson.com>
Fri, 24 Feb 2017 10:33:31 +0000 (10:33 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 24 Feb 2017 10:33:31 +0000 (10:33 +0000)
1  2 
functest/opnfv_tests/sdn/onos/sfc/sfc_onos.py

@@@ -10,13 -10,15 +10,15 @@@ from pexpect import pxss
  
  import functest.utils.functest_logger as ft_logger
  
+ from functest.utils.constants import CONST
  OK = 200
  CREATED = 201
  ACCEPTED = 202
  NO_CONTENT = 204
  
  
 -class SfcOnos:
 +class SfcOnos(object):
      """Defines all the def function of SFC."""
  
      def __init__(self):
          self.ip_pool = 0
          self.vm_public_ip = []
          self.vm_public_id = []
+         self.cirros_username = CONST.openstack_image_username
+         self.cirros_password = CONST.openstack_image_password
          self.net_id1 = 0
          self.vm = []
          self.address = 0
  
              s = pxssh.pxssh()
              hostname = self.vm_public_ip[0]
-             username = "cirros"
-             password = "cubswin:)"
-             s.login(hostname,  username,  password)
+             s.login(hostname,  self.cirros_username,  self.cirros_password)
              s.sendline("ping -c 5 " + str(self.port_ip[2]))
              s.prompt()             # match the prompt
  
          def vm1(queue1):
              s = pxssh.pxssh()
              hostname = self.vm_public_ip[1]
-             username = "cirros"
-             password = "cubswin:)"
-             s.login(hostname,  username,  password)
+             s.login(hostname,  self.cirros_username,  self.cirros_password)
              s.sendline('sudo ./firewall')
              s.prompt()
              output_pack = s.before