Exemplo n.º 1
0
    def test_isValidPort(self):

        validPorts = [2, 3, 87, 35589]
        for port in validPorts:
            errorMsg = str(port) + " is not valid."
            self.assertTrue(Validate.isValidPort(port), msg=errorMsg)

        inValidPorts = [0, 'af', 76666]

        for port in inValidPorts:
            errorMsg = str(port) + " is not valid."
            self.assertFalse(Validate.isValidPort(port), msg=errorMsg)
Exemplo n.º 2
0
    def validate_params(self):

        if not Validate.isValidIP(self.vip_ip):
            self.errorHelper("VIP is not valid. Exiting.")

        for ip in self.target_ip:
            if not Validate.isValidIP(ip):
                self.errorHelper("Target ip are not valid. Exiting.")

        if not Validate.isValidPort(self.vip_port):
            self.errorHelper("Port not valid. Exiting.")


        if not Validate.isInterfaceUp(self.vip_interface):
            self.errorHelper(self.vip_interface+" is not up. Check using ifconfig. Exiting.")