def testValidateHostAddressWithInvalidFQDN(self):
        self.setUpMocks()
        validationMsg = network_utils.validateHostAddress("this-is-"
                                                          "invalid-fqdn")
        self.assertEqual("Host FQDN name 'this-is-invalid-fqdn' has no domain "
                         "suffix", validationMsg)

        validationMsg = network_utils.validateHostAddress("this.is."
                                                          "invalid.fqdn.")
        self.assertEqual("Host FQDN name 'this.is.invalid.fqdn.' has invalid "
                         "domain name", validationMsg)

        validationMsg = network_utils.validateHostAddress("test.host."
                                                          "com.notfound")
        self.assertEqual("The following addreses: 'set(['82.94.164.162'])' "
                         "can't be mapped to non loopback devices on this "
                         "host", validationMsg)
    def testValidateHostAddressWithInvalidFQDN(self):
        self.setUpMocks()
        validationMsg = network_utils.validateHostAddress("this-is-"
                                                          "invalid-fqdn")
        self.assertEqual(
            "Host FQDN name 'this-is-invalid-fqdn' has no domain "
            "suffix", validationMsg)

        validationMsg = network_utils.validateHostAddress("this.is."
                                                          "invalid.fqdn.")
        self.assertEqual(
            "Host FQDN name 'this.is.invalid.fqdn.' has invalid "
            "domain name", validationMsg)

        validationMsg = network_utils.validateHostAddress("test.host."
                                                          "com.notfound")
        self.assertEqual(
            "The following addreses: 'set(['82.94.164.162'])' "
            "can't be mapped to non loopback devices on this "
            "host", validationMsg)
 def testValidateHostAddressWithValidFQDN(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress("test.host.com")
     self.assertEqual(None, validationMsg)
 def testValidateHostAddressWithValidAddress(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress("10.70.42.1")
     self.assertEqual(None, validationMsg)
 def testValidateHostAddressWithLoopBackAddress(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress("127.0.0.1")
     self.assertEqual(
         "Address '127.0.0.1' can't be mapped to non loopback "
         "devices on this host", validationMsg)
 def testValidateHostAddressWithEmptyAddress(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress(None)
     self.assertEqual('Please specify host Address', validationMsg)
 def testValidateHostAddressWithValidFQDN(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress("test.host.com")
     self.assertEqual(None, validationMsg)
 def testValidateHostAddressWithValidAddress(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress("10.70.42.1")
     self.assertEqual(None, validationMsg)
 def testValidateHostAddressWithLoopBackAddress(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress("127.0.0.1")
     self.assertEqual("Address '127.0.0.1' can't be mapped to non loopback "
                      "devices on this host", validationMsg)
 def testValidateHostAddressWithEmptyAddress(self):
     self.setUpMocks()
     validationMsg = network_utils.validateHostAddress(None)
     self.assertEqual('Please specify host Address', validationMsg)