Пример #1
0
    def test_disable_s390x_invalid(self, mock_load, mock_get, mock_is_file):

        """
        Unittest to disable SMT invalid scenario.
        """
        info = {
            "persisted_smt_settings": {"status": "enabled", "smt": "2"},
            "current_smt_settings": {"status": "disabled", "smt": "nosmt"}
        }
        name = "dummy"

        with self.assertRaisesRegexp(InvalidOperation, 'GINSMT0005E'):
            mock_get.return_value = info
            mock_is_file.return_value = True
            mock_load.return_value = {}
            smtmodel = SmtModel()
            smtmodel.disable_smt_s390x(name)
Пример #2
0
    def test_disable_success(self, mock_load, mock_get, mock_is_file,
                             mock_shutil, mock_fileinput):

        """
        Unittest for disabling SMT success scenario.
        """
        info = {
            "persisted_smt_settings": {"status": "enabled", "smt": "2"},
            "current_smt_settings": {"status": "enabled", "smt": "nosmt"}
        }
        name = "dummy"
        mock_get.return_value = info
        mock_is_file.return_value = True
        mock_shutil.return_value = {}
        mock_fileinput.return_value = {}
        mock_load.return_value = {}
        smtmodel = SmtModel()
        smtmodel.disable_smt_s390x(name)
Пример #3
0
    def test_disable_s390x_invalid(self, mock_load, mock_get, mock_is_file):
        """
        Unittest to disable SMT invalid scenario.
        """
        info = {
            "persisted_smt_settings": {
                "status": "enabled",
                "smt": "2"
            },
            "current_smt_settings": {
                "status": "disabled",
                "smt": "nosmt"
            }
        }
        name = "dummy"

        with self.assertRaisesRegexp(InvalidOperation, 'GINSMT0005E'):
            mock_get.return_value = info
            mock_is_file.return_value = True
            mock_load.return_value = {}
            smtmodel = SmtModel()
            smtmodel.disable_smt_s390x(name)
Пример #4
0
    def test_disable_s390x_invalid(self, mock_load, mock_get, mock_is_file):
        """
        Unittest to disable SMT invalid scenario.
        """
        info = {
            'persisted_smt_settings': {
                'status': 'enabled',
                'smt': '2'
            },
            'current_smt_settings': {
                'status': 'disabled',
                'smt': 'nosmt'
            }
        }
        name = 'dummy'

        with self.assertRaisesRegexp(InvalidOperation, 'GINSMT0005E'):
            mock_get.return_value = info
            mock_is_file.return_value = True
            mock_load.return_value = {}
            smtmodel = SmtModel()
            smtmodel.disable_smt_s390x(name)
Пример #5
0
 def test_disable_success(self, mock_load, mock_get, mock_is_file,
                          mock_shutil, mock_fileinput):
     """
     Unittest for disabling SMT success scenario.
     """
     info = {
         "persisted_smt_settings": {
             "status": "enabled",
             "smt": "2"
         },
         "current_smt_settings": {
             "status": "enabled",
             "smt": "nosmt"
         }
     }
     name = "dummy"
     mock_get.return_value = info
     mock_is_file.return_value = True
     mock_shutil.return_value = {}
     mock_fileinput.return_value = {}
     mock_load.return_value = {}
     smtmodel = SmtModel()
     smtmodel.disable_smt_s390x(name)
Пример #6
0
 def test_disable_success(self, mock_load, mock_get, mock_is_file,
                          mock_shutil, mock_fileinput):
     """
     Unittest for disabling SMT success scenario.
     """
     info = {
         'persisted_smt_settings': {
             'status': 'enabled',
             'smt': '2'
         },
         'current_smt_settings': {
             'status': 'enabled',
             'smt': 'nosmt'
         }
     }
     name = 'dummy'
     mock_get.return_value = info
     mock_is_file.return_value = True
     mock_shutil.return_value = {}
     mock_fileinput.return_value = {}
     mock_load.return_value = {}
     smtmodel = SmtModel()
     smtmodel.disable_smt_s390x(name)