Ejemplo n.º 1
0
    def test_positive_add_remove_os_by_id(self):
        """Create a partition table then add and remove an operating system to it using
        IDs for association

        :id: 33b5ddca-2151-45cb-bf30-951c2733165f

        :expectedresults: Operating system is added to partition table

        :CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({'id': ptable['id'], 'operatingsystem-id': os['id']})
        ptable = PartitionTable.info({'id': ptable['id']})
        assert os['title'] in ptable['operating-systems']
        PartitionTable.remove_operating_system({'id': ptable['id'], 'operatingsystem-id': os['id']})
        ptable = PartitionTable.info({'id': ptable['id']})
        assert os['title'] not in ptable['operating-systems']
Ejemplo n.º 2
0
    def test_positive_remove_os_by_id(self):
        """Add an operating system to a partition table then remove it. Use IDs
        for removal

        :id: ee37be42-9ed3-44dd-9206-514e340e5524

        :expectedresults: Operating system is added then removed from partition
            table

        :CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({'id': ptable['id'], 'operatingsystem-id': os['id']})
        ptable = PartitionTable.info({'id': ptable['id']})
        PartitionTable.remove_operating_system(
            {'id': ptable['id'], 'operatingsystem-id': os['id']}
        )
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
Ejemplo n.º 3
0
    def test_positive_remove_os_by_id(self):
        """Add an operating system to a partition table then remove it

        @Feature: Partition Table

        @Assert: Operating system is added then removed from partition table
        """
        ptable = make_partition_table({'content': gen_string("alpha", 10)})
        os = make_os()
        PartitionTable.add_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertIn(os['title'], ptable['operating-systems'])
        PartitionTable.remove_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
Ejemplo n.º 4
0
    def test_positive_remove_os_by_name(self):
        """Add an operating system to a partition table then remove it. Use
        names for removal

        @Feature: Partition Table

        @Assert: Operating system is added then removed from partition table
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        PartitionTable.remove_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
Ejemplo n.º 5
0
    def test_positive_add_remove_os_by_name(self):
        """Create a partition table then add and remove an operating system to it using
        names for association

        :id: 99185fce-fb26-4019-845c-3e5db9afd714

        :expectedresults: Operating system is added to partition table

        :CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system(
            {'name': ptable['name'], 'operatingsystem': os['title']}
        )
        ptable = PartitionTable.info({'name': ptable['name']})
        assert os['title'] in ptable['operating-systems']
        PartitionTable.remove_operating_system(
            {'name': ptable['name'], 'operatingsystem': os['title']}
        )
        ptable = PartitionTable.info({'name': ptable['name']})
        assert os['title'] not in ptable['operating-systems']
Ejemplo n.º 6
0
    def test_positive_remove_os_by_name(self):
        """Add an operating system to a partition table then remove it. Use
        names for removal

        :id: f7544419-af4c-4dcf-8673-cad472745794

        :expectedresults: Operating system is added then removed from partition
            table

        :CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system(
            {'name': ptable['name'], 'operatingsystem': os['title']}
        )
        ptable = PartitionTable.info({'name': ptable['name']})
        PartitionTable.remove_operating_system(
            {'name': ptable['name'], 'operatingsystem': os['title']}
        )
        ptable = PartitionTable.info({'name': ptable['name']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
Ejemplo n.º 7
0
    def test_remove_os_ptable(self):
        """@Test: Check if associated operating system can be removed

        @Feature: Partition Table - Add operating system

        @Assert: Operating system removed

        """
        ptable = make_partition_table({'content': gen_string("alpha", 10)})
        os = make_os()
        PartitionTable.add_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertIn(os['title'], ptable['operating-systems'])
        PartitionTable.remove_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
Ejemplo n.º 8
0
    def test_positive_remove_os_by_name(self):
        """Add an operating system to a partition table then remove it. Use
        names for removal

        @id: f7544419-af4c-4dcf-8673-cad472745794

        @Assert: Operating system is added then removed from partition table

        @CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        PartitionTable.remove_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
Ejemplo n.º 9
0
    def test_positive_remove_os_by_id(self):
        """Add an operating system to a partition table then remove it. Use IDs
        for removal

        @id: ee37be42-9ed3-44dd-9206-514e340e5524

        @Assert: Operating system is added then removed from partition table

        @CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        PartitionTable.remove_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
Ejemplo n.º 10
0
    def test_removeoperatingsystem_ptable(self):
        """@Test: Check if associated operating system can be removed

        @Feature: Partition Table - Add operating system

        @Assert: Operating system removed

        """
        content = gen_string("alpha", 10)
        name = gen_string("alpha", 10)
        try:
            ptable = make_partition_table({'name': name, 'content': content})
            os = make_os()
        except CLIFactoryError as err:
            self.fail(err)

        args = {
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        }

        result = PartitionTable.add_operating_system(args)
        self.assertEqual(result.return_code, 0, "Association Failed")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")

        result = PartitionTable.info({'id': ptable['id']})
        self.assertIn(os['title'],
                      result.stdout['operating-systems'])

        result = PartitionTable.remove_operating_system(args)
        self.assertEqual(result.return_code, 0, "Association Failed")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")

        result = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(
            os['title'],
            result.stdout['operating-systems'])
Ejemplo n.º 11
0
    def test_removeoperatingsystem_ptable(self):
        """@Test: Check if associated operating system can be removed

        @Feature: Partition Table - Add operating system

        @Assert: Operating system removed

        """
        content = gen_string("alpha", 10)
        name = gen_string("alpha", 10)
        try:
            ptable = make_partition_table({'name': name, 'content': content})
            os = make_os()
        except CLIFactoryError as err:
            self.fail(err)

        args = {
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        }

        result = PartitionTable.add_operating_system(args)
        self.assertEqual(result.return_code, 0, "Association Failed")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")

        result = PartitionTable.info({'id': ptable['id']})
        self.assertIn(os['title'], result.stdout['operating-systems'])

        result = PartitionTable.remove_operating_system(args)
        self.assertEqual(result.return_code, 0, "Association Failed")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")

        result = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(os['title'], result.stdout['operating-systems'])