예제 #1
0
 def test_get_password_data(self, query, get_provider, get_location, _get_node):
     query.return_value = [{"passwordData": PASS_DATA}]
     _get_node.return_value = {"instanceId": "i-abcdef"}
     get_location.return_value = "us-west2"
     get_provider.return_value = "ec2"
     with salt.utils.files.fopen(self.key_file, "w") as fp:
         fp.write(PRIVKEY_DATA)
     ret = ec2.get_password_data(
         name="i-abcddef", kwargs={"key_file": self.key_file}, call="action"
     )
     assert ret["passwordData"] == PASS_DATA
     assert ret["password"] == "testp4ss!"
예제 #2
0
파일: test_ec2.py 프로젝트: yuri-1987/salt
 def test_get_password_data(self, query, get_provider, get_location,
                            _get_node):
     query.return_value = [{'passwordData': PASS_DATA}]
     _get_node.return_value = {'instanceId': 'i-abcdef'}
     get_location.return_value = 'us-west2'
     get_provider.return_value = 'ec2'
     with salt.utils.files.fopen(self.key_file, 'w') as fp:
         fp.write(PRIVKEY_DATA)
     ret = ec2.get_password_data(name='i-abcddef',
                                 kwargs={'key_file': self.key_file},
                                 call='action')
     assert ret['passwordData'] == PASS_DATA
     assert ret['password'] == b'testp4ss!'