Example #1
0
    def validate(self, task):
        """Validate the driver_info in the node

        Check if the driver_info contains correct required fields

        :param task: a TaskManager instance contains the target node
        :raises: MissingParameterValue if any required parameters are missing.
        :raises: InvalidParameterValue if any parameters have invalid values.
        """
        # FIXME(lintan): validate hangs if unable to reach AMT, so dont
        # connect to the node until bug 1314961 is resolved.
        amt_common.parse_driver_info(task.node)
Example #2
0
    def validate(self, task):
        """Validate the driver_info in the node.

        Check if the driver_info contains correct required fields

        :param task: a TaskManager instance contains the target node.
        :raises: MissingParameterValue if any required parameters are missing.
        :raises: InvalidParameterValue if any parameters have invalid values.
        """
        # FIXME(lintan): validate hangs if unable to reach AMT, so dont
        # connect to the node until bug 1314961 is resolved.
        amt_common.parse_driver_info(task.node)
Example #3
0
    def test_parse_driver_info(self):
        info = amt_common.parse_driver_info(self.node)

        self.assertIsNotNone(info.get('address'))
        self.assertIsNotNone(info.get('username'))
        self.assertIsNotNone(info.get('password'))
        self.assertIsNotNone(info.get('protocol'))
        self.assertIsNotNone(info.get('uuid'))
Example #4
0
    def test_parse_driver_info(self):
        info = amt_common.parse_driver_info(self.node)

        self.assertIsNotNone(info.get("address"))
        self.assertIsNotNone(info.get("username"))
        self.assertIsNotNone(info.get("password"))
        self.assertIsNotNone(info.get("protocol"))
        self.assertIsNotNone(info.get("uuid"))
Example #5
0
    def test_parse_driver_info(self):
        info = amt_common.parse_driver_info(self.node)

        self.assertIsNotNone(info.get('address'))
        self.assertIsNotNone(info.get('username'))
        self.assertIsNotNone(info.get('password'))
        self.assertIsNotNone(info.get('protocol'))
        self.assertIsNotNone(info.get('uuid'))
Example #6
0
    def test_parse_driver_info(self):
        info = amt_common.parse_driver_info(self.node)

        self.assertEqual(b'1.2.3.4', info['address'])
        self.assertEqual(b'admin', info['username'])
        self.assertEqual(b'fake', info['password'])
        self.assertEqual(INFO_DICT['amt_protocol'], info['protocol'])
        self.assertEqual('1be26c0b-03f2-4d2e-ae87-c02d7f33c123', info['uuid'])
Example #7
0
    def test_get_wsman_client(self, mock_client):
        info = amt_common.parse_driver_info(self.node)
        amt_common.get_wsman_client(self.node)
        options = {'address': info['address'],
                   'protocol': info['protocol'],
                   'username': info['username'],
                   'password': info['password']}

        mock_client.assert_called_once_with(**options)
Example #8
0
    def test_parse_driver_info(self):
        info = amt_common.parse_driver_info(self.node)

        self.assertEqual(b'1.2.3.4', info['address'])
        self.assertEqual(b'admin', info['username'])
        self.assertEqual(b'fake', info['password'])
        self.assertEqual(INFO_DICT['amt_protocol'], info['protocol'])
        self.assertEqual('1be26c0b-03f2-4d2e-ae87-c02d7f33c123',
                         info['uuid'])
Example #9
0
    def test_get_wsman_client(self, mock_client):
        info = amt_common.parse_driver_info(self.node)
        amt_common.get_wsman_client(self.node)
        options = {'address': info['address'],
                   'protocol': info['protocol'],
                   'username': info['username'],
                   'password': info['password']}

        mock_client.assert_called_once_with(**options)
Example #10
0
    def test_get_wsman_client(self, mock_client):
        info = amt_common.parse_driver_info(self.node)
        amt_common.get_wsman_client(self.node)
        options = {
            "address": info["address"],
            "protocol": info["protocol"],
            "username": info["username"],
            "password": info["password"],
        }

        mock_client.assert_called_once_with(**options)
Example #11
0
 def test_parse_driver_info_missing_protocol(self):
     del self.node.driver_info["amt_protocol"]
     info = amt_common.parse_driver_info(self.node)
     self.assertEqual("http", info.get("protocol"))
Example #12
0
 def test_parse_driver_info_missing_protocol(self):
     del self.node.driver_info['amt_protocol']
     info = amt_common.parse_driver_info(self.node)
     self.assertEqual('http', info.get('protocol'))
Example #13
0
 def test_parse_driver_info_missing_protocol(self):
     del self.node.driver_info['amt_protocol']
     info = amt_common.parse_driver_info(self.node)
     self.assertEqual('http', info['protocol'])