Ejemplo n.º 1
0
    def test_nuage_vsp_device(self):
        """ Test Nuage VSP device in the Nuage VSP Physical Network
        """

        # 1. Verify that the Nuage VSP network service provider is successfully created and enabled in the Nuage VSP
        #    Physical Network.
        # 2. Verify that the Nuage VSP device is successfully created in the Nuage VSP Physical Network.
        # 3. Delete the Nuage VSP device in the Nuage VSP Physical Network, verify that the Nuage VSP device is
        #    successfully deleted in the Nuage VSP Physical Network.
        # 4. Add the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials, verify that the
        #    Nuage VSP device failed to add in the Nuage VSP Physical Network.
        # 5. Add the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials, verify that the
        #    Nuage VSP device is successfully added in the Nuage VSP Physical Network.

        # Nuage VSP network service provider validation
        self.debug("Validating the Nuage VSP network service provider in the Nuage VSP Physical Network...")
        self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")

        # Nuage VSP device validation
        self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
        self.validate_NuageVspDevice()

        # Nuage VSP device deletion
        self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical Network...")
        self.delete_NuageVspDevice()

        # Nuage VSP device validation
        self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
        with self.assertRaises(Exception):
            self.validate_NuageVspDevice()
        self.debug("Successfully deleted the Nuage VSP device in the Nuage VSP Physical Network")

        # Adding the Nuage VSP device with invalid VSD credentials
        self.debug("Adding the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials...")
        vsd_info = self.nuage_vsp_device.__dict__
        invalid_vsd_info = copy.deepcopy(vsd_info)
        invalid_vsd_info["password"] = ""
        with self.assertRaises(Exception):
            Nuage.add(self.api_client, invalid_vsd_info, self.vsp_physical_network.id)
        self.debug("Failed to add the Nuage VSP device in the Nuage VSP Physical Network due to invalid VSD "
                   "credentials")

        # Nuage VSP device validation
        self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
        with self.assertRaises(Exception):
            self.validate_NuageVspDevice()
        self.debug("The Nuage VSP device is not added in the Nuage VSP Physical Network")

        # Adding the Nuage VSP device with valid VSD credentials
        self.debug("Adding the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials...")
        Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)

        # Nuage VSP device validation
        self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
        self.validate_NuageVspDevice()
Ejemplo n.º 2
0
    def test_nuage_vsp_device(self):
        """ Test Nuage VSP device in the Nuage VSP Physical Network
        """

        # 1. Verify that the Nuage VSP network service provider is successfully created and enabled in the Nuage VSP
        #    Physical Network.
        # 2. Verify that the Nuage VSP device is successfully created in the Nuage VSP Physical Network.
        # 3. Delete the Nuage VSP device in the Nuage VSP Physical Network, verify that the Nuage VSP device is
        #    successfully deleted in the Nuage VSP Physical Network.
        # 4. Add the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials, verify that the
        #    Nuage VSP device failed to add in the Nuage VSP Physical Network.
        # 5. Add the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials, verify that the
        #    Nuage VSP device is successfully added in the Nuage VSP Physical Network.

        # Nuage VSP network service provider validation
        self.debug(
            "Validating the Nuage VSP network service provider in the Nuage VSP Physical Network..."
        )
        self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")

        # Nuage VSP device validation
        self.debug(
            "Validating the Nuage VSP device in the Nuage VSP Physical Network..."
        )
        self.validate_NuageVspDevice()

        # Nuage VSP device deletion
        self.debug(
            "Deleting the Nuage VSP device in the Nuage VSP Physical Network..."
        )
        self.delete_NuageVspDevice()

        # Nuage VSP device validation
        self.debug(
            "Validating the Nuage VSP device in the Nuage VSP Physical Network..."
        )
        with self.assertRaises(Exception):
            self.validate_NuageVspDevice()
        self.debug(
            "Successfully deleted the Nuage VSP device in the Nuage VSP Physical Network"
        )

        # Adding the Nuage VSP device with invalid VSD credentials
        self.debug(
            "Adding the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials..."
        )
        vsd_info = self.nuage_vsp_device.__dict__
        invalid_vsd_info = copy.deepcopy(vsd_info)
        invalid_vsd_info["password"] = ""
        with self.assertRaises(Exception):
            Nuage.add(self.api_client, invalid_vsd_info,
                      self.vsp_physical_network.id)
        self.debug(
            "Failed to add the Nuage VSP device in the Nuage VSP Physical Network due to invalid VSD "
            "credentials")

        # Nuage VSP device validation
        self.debug(
            "Validating the Nuage VSP device in the Nuage VSP Physical Network..."
        )
        with self.assertRaises(Exception):
            self.validate_NuageVspDevice()
        self.debug(
            "The Nuage VSP device is not added in the Nuage VSP Physical Network"
        )

        # Adding the Nuage VSP device with valid VSD credentials
        self.debug(
            "Adding the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials..."
        )
        Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)

        # Nuage VSP device validation
        self.debug(
            "Validating the Nuage VSP device in the Nuage VSP Physical Network..."
        )
        self.validate_NuageVspDevice()
Ejemplo n.º 3
0
    def test_nuage_vsp_device(self):
        """ Test Nuage VSP device in the Nuage VSP Physical Network
        """

        # 1. Verify that the Nuage VSP network service provider is successfully
        #    created and enabled in the Nuage VSP Physical Network.
        # 2. Verify that the Nuage VSP device is successfully created in the
        #    Nuage VSP Physical Network.
        # 3. Delete the Nuage VSP device in the Nuage VSP Physical Network,
        #    verify that the Nuage VSP device is successfully deleted in the
        #    Nuage VSP Physical Network.
        # 4. Add the Nuage VSP device in the Nuage VSP Physical Network with
        #    invalid VSD credentials, verify that the Nuage VSP device failed
        #    to add in the Nuage VSP Physical Network.
        # 5. Add the Nuage VSP device in the Nuage VSP Physical Network with
        #    valid VSD credentials, verify that the Nuage VSP device is
        #    successfully added in the Nuage VSP Physical Network.

        for zone in self.zones:
            self.debug("Zone - %s" % zone.name)
            # Get Zone details
            self.getZoneDetails(zone=zone)
            # Configure VSD sessions
            self.configureVSDSessions()

            # Nuage VSP network service provider validation
            self.debug("Validating the Nuage VSP network service provider in "
                       "the Nuage VSP Physical Network...")
            self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            self.validate_NuageVspDevice()

            # Nuage VSP device deletion
            self.debug("Deleting the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            self.delete_NuageVspDevice()

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            with self.assertRaises(Exception):
                self.validate_NuageVspDevice()
            self.debug("Successfully deleted the Nuage VSP device in the "
                       "Nuage VSP Physical Network")

            # Adding the Nuage VSP device with invalid VSD credentials
            self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
                       "Network with invalid VSD credentials...")
            vsd_info = self.nuage_vsp_device.__dict__
            invalid_vsd_info = copy.deepcopy(vsd_info)
            invalid_vsd_info["password"] = ""
            with self.assertRaises(Exception):
                Nuage.add(self.api_client, invalid_vsd_info,
                          self.vsp_physical_network.id)
            self.debug("Failed to add the Nuage VSP device in the Nuage VSP "
                       "Physical Network due to invalid VSD credentials")

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            with self.assertRaises(Exception):
                self.validate_NuageVspDevice()
            self.debug("The Nuage VSP device is not added in the Nuage VSP "
                       "Physical Network")

            # Adding the Nuage VSP device with valid VSD credentials
            self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
                       "Network with valid VSD credentials...")
            Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            self.validate_NuageVspDevice()
Ejemplo n.º 4
0
    def test_nuage_vsp_device(self):
        """ Test Nuage VSP device in the Nuage VSP Physical Network
        """

        # 1. Verify that the Nuage VSP network service provider is successfully
        #    created and enabled in the Nuage VSP Physical Network.
        # 2. Verify that the Nuage VSP device is successfully created in the
        #    Nuage VSP Physical Network.
        # 3. Delete the Nuage VSP device in the Nuage VSP Physical Network,
        #    verify that the Nuage VSP device is successfully deleted in the
        #    Nuage VSP Physical Network.
        # 4. Add the Nuage VSP device in the Nuage VSP Physical Network with
        #    invalid VSD credentials, verify that the Nuage VSP device failed
        #    to add in the Nuage VSP Physical Network.
        # 5. Add the Nuage VSP device in the Nuage VSP Physical Network with
        #    valid VSD credentials, verify that the Nuage VSP device is
        #    successfully added in the Nuage VSP Physical Network.

        for zone in self.zones:
            self.debug("Zone - %s" % zone.name)
            # Get Zone details
            self.getZoneDetails(zone=zone)
            # Configure VSD sessions
            self.configureVSDSessions()

            # Nuage VSP network service provider validation
            self.debug("Validating the Nuage VSP network service provider in "
                       "the Nuage VSP Physical Network...")
            self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            self.validate_NuageVspDevice()

            # Nuage VSP device deletion
            self.debug("Deleting the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            self.delete_NuageVspDevice()

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            with self.assertRaises(Exception):
                self.validate_NuageVspDevice()
            self.debug("Successfully deleted the Nuage VSP device in the "
                       "Nuage VSP Physical Network")

            # Adding the Nuage VSP device with invalid VSD credentials
            self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
                       "Network with invalid VSD credentials...")
            vsd_info = self.nuage_vsp_device.__dict__
            invalid_vsd_info = copy.deepcopy(vsd_info)
            invalid_vsd_info["password"] = ""
            with self.assertRaises(Exception):
                Nuage.add(
                    self.api_client, invalid_vsd_info,
                    self.vsp_physical_network.id)
            self.debug("Failed to add the Nuage VSP device in the Nuage VSP "
                       "Physical Network due to invalid VSD credentials")

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            with self.assertRaises(Exception):
                self.validate_NuageVspDevice()
            self.debug("The Nuage VSP device is not added in the Nuage VSP "
                       "Physical Network")

            # Adding the Nuage VSP device with valid VSD credentials
            self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
                       "Network with valid VSD credentials...")
            Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)

            # Nuage VSP device validation
            self.debug("Validating the Nuage VSP device in the Nuage VSP "
                       "Physical Network...")
            self.validate_NuageVspDevice()