Example #1
0
    def prepareSshKeys(self, duthost, ptfhost):
        '''
            Prepares testbed ssh keys by generating ssh key on ptf host and adding this key to known_hosts on duthost
            This class-scope fixture runs once before test start

            Args:
                duthost (AnsibleHost): Device Under Test (DUT)
                ptfhost (AnsibleHost): Packet Test Framework (PTF)

            Returns:
                None
        '''
        invetory = duthost.host.options['inventory'].split('/')[-1]
        secrets = duthost.host.options['variable_manager']._hostvars[
            duthost.hostname]['secret_group_vars']

        prepareTestbedSshKeys(duthost, ptfhost,
                              secrets[invetory]['sonicadmin_user'])
Example #2
0
 def __prepareTestbedSshKeys(self):
     '''
     Prepares testbed ssh keys by generating ssh key on ptf host and adding this key to known_hosts on duthost
     '''
     prepareTestbedSshKeys(self.duthost, self.ptfhost,
                           self.rebootData['dut_username'])