class TestKeypair(helpers.TestCase): """Checks that the user is able to create/delete keypair.""" KEYPAIR_NAME = helpers.gen_random_resource_name("keypair") def test_keypair(self): keypair_page = self.home_pg.go_to_accessandsecurity_keypairspage() keypair_page.create_keypair(self.KEYPAIR_NAME) keypair_page = self.home_pg.go_to_accessandsecurity_keypairspage() self.assertTrue(keypair_page.is_keypair_present(self.KEYPAIR_NAME)) keypair_page.delete_keypair(self.KEYPAIR_NAME) self.assertFalse(keypair_page.is_keypair_present(self.KEYPAIR_NAME))
class TestImage(helpers.TestCase): IMAGE_NAME = helpers.gen_random_resource_name("image") def test_image_create_delete(self): """tests the image creation and deletion functionalities: * creates a new image from horizon.conf http_image * verifies the image appears in the images table as active * deletes the newly created image * verifies the image does not appear in the table after deletion """ images_page = self.home_pg.go_to_compute_imagespage() images_page.create_image(self.IMAGE_NAME) self.assertTrue(images_page.is_image_present(self.IMAGE_NAME)) self.assertTrue(images_page.is_image_active(self.IMAGE_NAME)) images_page.delete_image(self.IMAGE_NAME) self.assertFalse(images_page.is_image_present(self.IMAGE_NAME))
class TestFlavors(helpers.AdminTestCase): FLAVOR_NAME = helpers.gen_random_resource_name("flavor") def test_flavor_create(self): """tests the flavor creation and deletion functionalities: * creates a new flavor * verifies the flavor appears in the flavors table * deletes the newly created flavor * verifies the flavor does not appear in the table after deletion """ flavors_page = self.home_pg.go_to_system_flavorspage() flavors_page.create_flavor(name=self.FLAVOR_NAME, vcpus=1, ram=1024, root_disk=20, ephemeral_disk=0, swap_disk=0) self.assertTrue(flavors_page.is_flavor_present(self.FLAVOR_NAME)) flavors_page.delete_flavor(self.FLAVOR_NAME) self.assertFalse(flavors_page.is_flavor_present(self.FLAVOR_NAME))
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from horizon.integration_tests import helpers from horizon.integration_tests.pages.project.data_processing\ import jobbinariespage from horizon.integration_tests.tests import decorators JOB_BINARY_INTERNAL = { # Size of binary name is limited to 50 characters jobbinariespage.JobbinariesPage.BINARY_NAME: helpers.gen_random_resource_name(resource='jobbinary', timestamp=False)[0:50], jobbinariespage.JobbinariesPage.BINARY_STORAGE_TYPE: "Internal database", jobbinariespage.JobbinariesPage.BINARY_URL: None, jobbinariespage.JobbinariesPage.INTERNAL_BINARY: "*Create a script", jobbinariespage.JobbinariesPage.BINARY_PATH: None, jobbinariespage.JobbinariesPage.SCRIPT_NAME: helpers.gen_random_resource_name(resource='scriptname', timestamp=False), jobbinariespage.JobbinariesPage.SCRIPT_TEXT: "test_script_text", jobbinariespage.JobbinariesPage.USERNAME: None, jobbinariespage.JobbinariesPage.PASSWORD:
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from horizon.integration_tests import helpers from horizon.integration_tests.tests import decorators IMAGE_NAME = helpers.gen_random_resource_name("image") @decorators.services_required("sahara") class TestSaharaImageRegistry(helpers.TestCase): def setUp(self): super(TestSaharaImageRegistry, self).setUp() image_pg = self.home_pg.go_to_compute_imagespage() image_pg.create_image(IMAGE_NAME) image_pg.wait_until_image_active(IMAGE_NAME) def test_image_register_unregister(self): """Test the image registration in Sahara.""" image_reg_pg = self.home_pg.go_to_dataprocessing_imageregistrypage() image_reg_pg.register_image(IMAGE_NAME, self.CONFIG.scenario.ssh_user, "Test description")