예제 #1
0
 def test_system_purpose_task(self, give_the_system_purpose):
     """Test the SystemPurposeConfigurationTask task - not yet set."""
     # prepare some system purpose data
     system_purpose_data = SystemPurposeData()
     system_purpose_data.role = "foo"
     system_purpose_data.sla = "bar"
     system_purpose_data.usage = "baz"
     system_purpose_data.addons = ["a", "b", "c"]
     task = SystemPurposeConfigurationTask(system_purpose_data)
     task.run()
     give_the_system_purpose.assert_called_once_with(sysroot="/",
                                                     role="foo",
                                                     sla="bar",
                                                     usage="baz",
                                                     addons=["a", "b", "c"])
예제 #2
0
 def set_system_purpose_with_task(self):
     """Set system purpose for the installed system with an installation task.
     :return: a DBus path of an installation task
     """
     task = SystemPurposeConfigurationTask(
         system_purpose_data=self.system_purpose_data)
     return task
예제 #3
0
 def set_system_purpose_with_task(self):
     """Set system purpose for the installed system with an installation task.
     :return: a DBus path of an installation task
     """
     rhsm_syspurpose_proxy = self.rhsm_observer.get_proxy(RHSM_SYSPURPOSE)
     task = SystemPurposeConfigurationTask(
         rhsm_syspurpose_proxy=rhsm_syspurpose_proxy,
         system_purpose_data=self.system_purpose_data)
     return task
예제 #4
0
 def test_system_purpose_task_already_set(self, give_the_system_purpose,
                                          check_set):
     """Test the SystemPurposeConfigurationTask task - already set."""
     # The task should still run give_the_system_purpose() even if system purpose
     # has already been set to make it possible to overwrite or clear existing data.
     check_set.return_value = True
     # prepare some system purpose data
     system_purpose_data = SystemPurposeData()
     system_purpose_data.role = "foo"
     system_purpose_data.sla = "bar"
     system_purpose_data.usage = "baz"
     system_purpose_data.addons = ["a", "b", "c"]
     task = SystemPurposeConfigurationTask(system_purpose_data)
     task.run()
     give_the_system_purpose.assert_called_once_with(sysroot="/",
                                                     role="foo",
                                                     sla="bar",
                                                     usage="baz",
                                                     addons=["a", "b", "c"])
예제 #5
0
 def _apply_syspurpose(self):
     """Apply system purpose information to the installation environment."""
     log.debug("subscription: Applying system purpose data")
     task = SystemPurposeConfigurationTask(
         system_purpose_data=self.system_purpose_data)
     task.run()