def test_positive_unhide_parameter_default_value(self):
        """Unhide the default value of parameter.

        @id: 3daf662f-a0dd-469c-8088-262bfaa5246a

        @steps:

        1. Set the override flag for the parameter.
        2. Set some valid default value.
        3. Set 'Hidden Value' to true and submit.
        4. After hiding, set the 'Hidden Value' to false.

        @assert: The 'hidden value' set to false for that parameter.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'default-value': gen_string('alpha'),
            'hidden-value': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['hidden-value?'], True)
        SmartClassParameter.update({
            'id': sc_param_id,
            'hidden-value': 0,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['hidden-value?'], False)
    def test_positive_update_hidden_value_in_parameter(self):
        """Update the hidden default value of parameter.

        @id: 8602abc9-80bd-412d-bf46-68a1c7f832e4

        @steps:

        1. Set the override flag for the parameter.
        2. Set some valid default value.
        3. Set 'Hidden Value' to true and submit.
        4. Now in hidden state, update the default value.

        @assert:

        1. The parameter default value is updated.
        2. The 'hidden value' displayed as true for that parameter.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        old_value = gen_string("alpha")
        new_value = gen_string("alpha")
        SmartClassParameter.update({"id": sc_param_id, "override": 1, "default-value": old_value, "hidden-value": 1})
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertEqual(sc_param["hidden-value?"], True)
        self.assertEqual(sc_param["default-value"], old_value)
        SmartClassParameter.update({"id": sc_param_id, "default-value": new_value})
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertEqual(sc_param["hidden-value?"], True)
        self.assertEqual(sc_param["default-value"], new_value)
    def test_positive_remove_matcher(self):
        """Removal of matcher from parameter.

        @id: f51ea9ca-f57c-482e-841f-3ea5cc8f8958

        @steps:

        1. Override the parameter and create a matcher for some attribute.
        2. Remove the matcher created in step 1.

        @assert: The matcher removed from parameter.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        value = gen_string('alpha')
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'is_virtual=true',
            'value': value
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(len(sc_param['override-values']['values']), 1)
        SmartClassParameter.remove_override_value({
            'smart-class-parameter-id': sc_param_id,
            'id': sc_param['override-values']['values']['1']['id'],
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(len(sc_param['override-values']['values']), 0)
    def test_positive_list_parameters_by_hostgroup_id(self):
        """List all the parameters included in specific HostGroup by id.

        @id: 80c1058d-b87d-4c09-957f-7d3daacdedf4

        @assert: Parameters listed for specific HostGroup.

        @CaseLevel: Integration
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['override'], True)
        hostgroup = make_hostgroup({
            'environment-id': self.env['id'],
            'puppet-class-ids': self.puppet_class['id']
        })
        hostgroup_sc_params = HostGroup.sc_params({
            u'hostgroup-id': hostgroup['id']})
        self.assertGreater(len(hostgroup_sc_params), 0)
Example #5
0
    def test_positive_override(self):
        """Override the Default Parameter value.

        :id: 25e34bac-084c-4b68-a082-822633e19f7e

        :steps:

            1.  Override the parameter.
            2.  Set the new valid Default Value.
            3.  Set puppet default value to 'Use Puppet Default'.
            4.  Submit the changes.

        :expectedresults: Parameter Value overridden with new value.

        :BZ: 1830834

        :CaseImportance: Medium
        """
        sc_param_id = self.sc_params_ids_list.pop()
        value = gen_string('alpha')
        SmartClassParameter.update(
            {'default-value': value, 'omit': 1, 'id': sc_param_id, 'override': 1}
        )
        sc_param = SmartClassParameter.info(
            {'puppet-class': self.puppet_class['name'], 'id': sc_param_id}
        )
        self.assertEqual(sc_param['default-value'], value)
        self.assertEqual(sc_param['omit'], True)
    def test_positive_create_matcher(self):
        """Create matcher for attribute in parameter.

        @id: 37fe299b-1e81-4faf-b1c3-2edfc3d53dc1

        @steps:

        1.  Override the parameter.
        2.  Set some default Value.
        3.  Create a matcher with all valid values.
        4.  Submit the change.

        @assert: The matcher has been created successfully.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        value = gen_string('alpha')
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'is_virtual=true',
            'value': value
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(
            sc_param['override-values']['values']['1']['match'],
            'is_virtual=true'
        )
        self.assertEqual(
            sc_param['override-values']['values']['1']['value'], value)
    def test_negative_validate_matcher_value_with_list(self):
        """Error raised for matcher value not in list.

        @id: 6e02c3f2-40aa-49ec-976d-7a12f5fa1e04

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that doesn't match
        the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error raised for matcher value not in list.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=test.com',
            'value': 'myexample'
        })
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update({
                'id': sc_param_id,
                'default-value': '50',
                'override': 1,
                'validator-type': 'list',
                'validator-rule': '25, example, 50',
            })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertNotEqual(sc_param['default-value'], '50')
    def test_negative_validate_default_value_with_list(self):
        """Error raised for default value not in list.

        @id: cdcafbea-612e-4b60-90de-fa0c76442bbe

        @steps:

        1.  Override the parameter.
        2.  Provide default value that doesn't matches the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error raised for default value not in list.
        """
        value = gen_string("alphanumeric")
        sc_param_id = self.sc_params_ids_list.pop()
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update(
                {
                    "id": sc_param_id,
                    "default-value": value,
                    "override": 1,
                    "validator-type": "list",
                    "validator-rule": "5, test",
                }
            )
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertNotEqual(sc_param["default-value"], value)
    def test_negative_validate_default_value_with_regex(self):
        """Error raised for default value not matching with regex.

        @id: f36ed6e8-04ef-4614-98b3-38703d8aeeb0

        @steps:

        1.  Override the parameter.
        2.  Provide default value that doesn't matches the regex of step 3.
        3.  Validate this value with regex validator type and rule.
        4.  Submit the change.

        @assert: Error raised for default value not matching with regex.
        """
        value = gen_string('alpha')
        sc_param_id = self.sc_params_ids_list.pop()
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update({
                'id': sc_param_id,
                'default-value': value,
                'override': 1,
                'validator-type': 'regexp',
                'validator-rule': '[0-9]',
            })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertNotEqual(sc_param['default-value'], value)
    def test_positive_validate_default_value_required_check(self):
        """No error raised for non-empty default Value - Required check.

        @id: 812aceb8-8d5e-4374-bf73-61d7085ee510

        @steps:

        1.  Override the parameter.
        2.  Provide some default value, Not empty.
        3.  Set '--required' check.
        4.  Submit the change.

        @assert: No error raised for non-empty default value
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'parameter-type': 'boolean',
            'id': sc_param_id,
            'default-value': u'true',
            'override': 1,
            'required': 1
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['required'], True)
        self.assertEqual(sc_param['default-value'], True)
    def test_positive_validate_default_value_with_list(self):
        """Error not raised for default value in list and required

        :id: b03708e8-e597-40fb-bb24-a1ac87475846

        :steps:

            1.  Override the parameter.
            2.  Provide default value that matches the list of step 3.
            3.  Validate this value with list validator type and rule.
            4.  Submit the change.

        :expectedresults: Error not raised for default value in list.

        :CaseImportance: Medium
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'default-value': 'test',
            'override': 1,
            'validator-type': 'list',
            'validator-rule': '5, test',
            'required': 1
        })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            self.puppet_class['name'],
            'id':
            sc_param_id,
        })
        self.assertEqual(sc_param['default-value'], 'test')
        self.assertEqual(sc_param['validator']['type'], 'list')
        self.assertEqual(sc_param['validator']['rule'], '5, test')
    def test_positive_create_matcher_puppet_default_value(self):
        """Create matcher for attribute in parameter,
        Where Value is puppet default value.

        @id: c08fcf25-e5c7-411e-beed-3741a24496fd

        @steps:

        1.  Override the parameter.
        2.  Set some default Value.
        3.  Create matcher with valid attribute type, name and
        puppet default value.
        4.  Submit the change.

        @assert: The matcher has been created successfully.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        value = gen_string("alpha")
        SmartClassParameter.update({"id": sc_param_id, "override": 1, "default-value": gen_string("alpha")})
        SmartClassParameter.add_override_value(
            {
                "smart-class-parameter-id": sc_param_id,
                "match": "domain=test.com",
                "value": value,
                "use-puppet-default": 1,
            }
        )
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertEqual(sc_param["override-values"]["values"]["1"]["match"], "domain=test.com")
        self.assertEqual(sc_param["override-values"]["values"]["1"]["value"], value)
    def test_negative_validate_default_value_with_list(self):
        """Error raised for default value not in list.

        :id: cdcafbea-612e-4b60-90de-fa0c76442bbe

        :steps:

            1.  Override the parameter.
            2.  Provide default value that doesn't matches the list of step 3.
            3.  Validate this value with list validator type and rule.
            4.  Submit the change.

        :expectedresults: Error raised for default value not in list.

        :CaseImportance: Medium
        """
        value = gen_string('alphanumeric')
        sc_param_id = self.sc_params_ids_list.pop()
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update({
                'id': sc_param_id,
                'default-value': value,
                'override': 1,
                'validator-type': 'list',
                'validator-rule': '5, test',
            })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            self.puppet_class['name'],
            'id':
            sc_param_id,
        })
        self.assertNotEqual(sc_param['default-value'], value)
    def test_positive_validate_matcher_value_with_list(self):
        """Error not raised for matcher value in list.

        @id: 16927050-0bf2-4cbd-bb34-43c669f81304

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that matches the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error not raised for matcher value in list.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value(
            {"smart-class-parameter-id": sc_param_id, "match": "domain=test.com", "value": "30"}
        )
        SmartClassParameter.update(
            {
                "id": sc_param_id,
                "default-value": "example",
                "override": 1,
                "validator-type": "list",
                "validator-rule": "test, example, 30",
            }
        )
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertEqual(sc_param["default-value"], "example")
    def test_negative_validate_matcher_value_with_list(self):
        """Error raised for matcher value not in list.

        @id: 6e02c3f2-40aa-49ec-976d-7a12f5fa1e04

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that doesn't match
        the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error raised for matcher value not in list.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value(
            {"smart-class-parameter-id": sc_param_id, "match": "domain=test.com", "value": "myexample"}
        )
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update(
                {
                    "id": sc_param_id,
                    "default-value": "50",
                    "override": 1,
                    "validator-type": "list",
                    "validator-rule": "25, example, 50",
                }
            )
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertNotEqual(sc_param["default-value"], "50")
    def test_positive_validate_default_value_with_list(self):
        """Error not raised for default value in list.

        @id: b03708e8-e597-40fb-bb24-a1ac87475846

        @steps:

        1.  Override the parameter.
        2.  Provide default value that matches the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error not raised for default value in list.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update(
            {
                "id": sc_param_id,
                "default-value": "test",
                "override": 1,
                "validator-type": "list",
                "validator-rule": "5, test",
            }
        )
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertEqual(sc_param["default-value"], "test")
        self.assertEqual(sc_param["validator"]["type"], "list")
        self.assertEqual(sc_param["validator"]["rule"], "5, test")
    def test_positive_override(self):
        """Override the Default Parameter value.

        @id: 25e34bac-084c-4b68-a082-822633e19f7e

        @steps:

        1.  Override the parameter.
        2.  Set the new valid Default Value.
        3.  Submit the changes.

        @assert: Parameter Value overridden with new value.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        value = gen_string('alpha')
        SmartClassParameter.update({
            'default-value': value,
            'id': sc_param_id,
            'override': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['default-value'], value)
    def test_positive_hide_parameter_default_value(self):
        """Hide the default value of parameter.

        @id: a1e206ae-67dc-48f0-886e-d543c682af34

        @steps:

        1. Set the override flag for the parameter.
        2. Set some valid default value.
        3. Set 'Hidden Value' to true.

        @assert: The 'hidden value' set to true for that parameter.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'default-value': gen_string('alpha'),
            'hidden-value': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['hidden-value?'], True)
    def test_negative_update_parameter_type(self):
        """Negative Parameter Update for parameter types - Invalid Value.

        Types - string, boolean, integer, real, array, hash, yaml, json

        @id: 5c2c859a-8164-4733-8b41-d37f333656c7

        @steps:

        1.  Override the parameter.
        2.  Update the Key Type.
        3.  Enter an 'Invalid' default Value.
        3.  Submit the changes.

        @assert:

        1.  Parameter not updated with string type for invalid value.
        2.  Error raised for invalid default value.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        for test_data in invalid_sc_parameters_data():
            with self.subTest(test_data):
                with self.assertRaises(CLIReturnCodeError):
                    SmartClassParameter.update({
                        'parameter-type': test_data['sc_type'],
                        'default-value': test_data['value'],
                        'id': sc_param_id,
                        'override': 1,
                    })
                sc_param = SmartClassParameter.info({
                    'puppet-class': self.puppet_class['name'],
                    'id': sc_param_id,
                })
                self.assertNotEqual(
                    sc_param['default-value'], test_data['value'])
    def test_negative_validate_matcher_value_with_regex(self):
        """Error raised for matcher value not matching with regex.

        @id: b8b2f1c2-a20c-42d6-a687-79e6eee0268e

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that doesn't match
        the regex of step 3.
        3.  Validate this value with regex validator type and rule.
        4.  Submit the change.

        @assert: Error raised for matcher value not matching with regex.
        """
        value = gen_string("numeric")
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value(
            {"smart-class-parameter-id": sc_param_id, "match": "domain=test.com", "value": gen_string("alpha")}
        )
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update(
                {
                    "id": sc_param_id,
                    "default-value": value,
                    "override": 1,
                    "validator-type": "regexp",
                    "validator-rule": "[0-9]",
                }
            )
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertNotEqual(sc_param["default-value"], value)
    def test_positive_validate_matcher_value_required_check(self):
        """Error not raised for matcher Value - Required check.

        @id: e62c3c5a-d900-44d4-9793-2c17202974e5

        @steps:

        1.  Override the parameter.
        2.  Create a matcher for Parameter for some attribute.
        3.  Provide some Value for matcher.
        4.  Set '--required' check.
        5.  Submit the change.

        @assert: Error not raised for matcher value.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=example.com',
            'value': gen_string('alpha')
        })
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'required': 1
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['required'], True)
    def test_negative_validate_default_value_with_list(self):
        """Error raised for default value not in list.

        @id: cdcafbea-612e-4b60-90de-fa0c76442bbe

        @steps:

        1.  Override the parameter.
        2.  Provide default value that doesn't matches the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error raised for default value not in list.
        """
        value = gen_string('alphanumeric')
        sc_param_id = self.sc_params_ids_list.pop()
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update({
                'id': sc_param_id,
                'default-value': value,
                'override': 1,
                'validator-type': 'list',
                'validator-rule': '5, test',
            })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertNotEqual(sc_param['default-value'], value)
    def test_positive_validate_default_value_with_regex(self):
        """Error not raised for default value matching with regex.

        @id: 74666d12-e3be-46c1-8bd5-18d86dcf7f4b

        @steps:

        1.  Override the parameter.
        2.  Provide default value that matches the regex of step 3.
        3.  Validate this value with regex validator type and rule.
        4.  Submit the change.

        @assert: Error not raised for default value matching with regex.
        """
        value = gen_string('numeric')
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'default-value': value,
            'override': 1,
            'validator-type': 'regexp',
            'validator-rule': '[0-9]',
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['default-value'], value)
        self.assertEqual(sc_param['validator']['type'], 'regexp')
        self.assertEqual(sc_param['validator']['rule'], '[0-9]')
    def test_positive_validate_matcher_value_with_regex(self):
        """Error not raised for matcher value matching with regex.

        @id: 2c8273aa-e621-4d4e-b03e-f8d50a596bc2

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that matches the regex of step 3.
        3.  Validate this value with regex validator type and rule.
        4.  Submit the change.

        @assert: Error not raised for matcher value matching with regex.
        """
        value = gen_string("numeric")
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value(
            {"smart-class-parameter-id": sc_param_id, "match": "domain=test.com", "value": gen_string("numeric")}
        )
        SmartClassParameter.update(
            {
                "id": sc_param_id,
                "default-value": value,
                "override": 1,
                "validator-type": "regexp",
                "validator-rule": "[0-9]",
            }
        )
        sc_param = SmartClassParameter.info({"puppet-class": "ntp", "id": sc_param_id})
        self.assertEqual(sc_param["default-value"], value)
    def test_positive_validate_matcher_value_with_regex(self):
        """Error not raised for matcher value matching with regex.

        @id: 2c8273aa-e621-4d4e-b03e-f8d50a596bc2

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that matches the regex of step 3.
        3.  Validate this value with regex validator type and rule.
        4.  Submit the change.

        @assert: Error not raised for matcher value matching with regex.
        """
        value = gen_string('numeric')
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=test.com',
            'value': gen_string('numeric')
        })
        SmartClassParameter.update({
            'id': sc_param_id,
            'default-value': value,
            'override': 1,
            'validator-type': 'regexp',
            'validator-rule': '[0-9]',
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['default-value'], value)
    def test_positive_hide_empty_default_value(self):
        """Hiding the empty default value.

        @id: 31069fff-c6d5-42b6-94f2-9551057eb15b

        @steps:

        1. Set the override flag for the parameter.
        2. Don't set any default value/Set empty value.
        3. Set 'Hidden Value' to true and submit.

        @assert:

        1. The 'hidden value' set to true for that parameter.
        2. The default value is still empty on hide.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'hidden-value': 1,
            'default-value': '',
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertFalse(sc_param['default-value'])
        self.assertEqual(sc_param['hidden-value?'], True)
    def test_positive_validate_default_value_with_list(self):
        """Error not raised for default value in list.

        @id: b03708e8-e597-40fb-bb24-a1ac87475846

        @steps:

        1.  Override the parameter.
        2.  Provide default value that matches the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error not raised for default value in list.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'default-value': 'test',
            'override': 1,
            'validator-type': 'list',
            'validator-rule': '5, test',
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['default-value'], 'test')
        self.assertEqual(sc_param['validator']['type'], 'list')
        self.assertEqual(sc_param['validator']['rule'], '5, test')
    def test_positive_list_parameters_by_host_name(self):
        """List all the parameters included in specific Host by its name.

        @id: a8165746-3480-4875-8931-b20ebec241dc

        @assert: Parameters listed for specific Host.

        @CaseLevel: Integration
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['override'], True)
        host = entities.Host(organization=self.org['id']).create()
        Host.update({
            u'name': host.name,
            u'environment': self.env['name'],
            u'puppet-classes': self.puppet_class['name'],
        })
        host_sc_params_list = Host.sc_params({u'host': host.name})
        self.assertGreater(len(host_sc_params_list), 0)
    def test_positive_validate_matcher_value_with_list(self):
        """Error not raised for matcher value in list.

        @id: 16927050-0bf2-4cbd-bb34-43c669f81304

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that matches the list of step 3.
        3.  Validate this value with list validator type and rule.
        4.  Submit the change.

        @assert: Error not raised for matcher value in list.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=test.com',
            'value': '30'
        })
        SmartClassParameter.update({
            'id': sc_param_id,
            'default-value': 'example',
            'override': 1,
            'validator-type': 'list',
            'validator-rule': 'test, example, 30',
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['default-value'], 'example')
    def test_positive_list_parameters_by_host_id(self):
        """List all the parameters included in specific Host by its id.

        @id: 79050de6-b894-4a88-b155-32bf488b692c

        @assert: Parameters listed for specific Host.

        @CaseLevel: Integration
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['override'], True)
        host = entities.Host(organization=self.org['id']).create()
        Host.update({
            u'name': host.name,
            u'environment': self.env['name'],
            u'puppet-classes': self.puppet_class['name'],
        })
        host_sc_params_list = Host.sc_params({u'host-id': host.id})
        self.assertGreater(len(host_sc_params_list), 0)
    def test_positive_create_matcher_puppet_default_value(self):
        """Create matcher for attribute in parameter,
        Where Value is puppet default value.

        @id: c08fcf25-e5c7-411e-beed-3741a24496fd

        @steps:

        1.  Override the parameter.
        2.  Set some default Value.
        3.  Create matcher with valid attribute type, name and
        puppet default value.
        4.  Submit the change.

        @assert: The matcher has been created successfully.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'default-value': gen_string('alpha'),
        })
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=test.com',
            'use-puppet-default': 1
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertEqual(
            sc_param['override-values']['values']['1']['match'],
            'domain=test.com'
        )
    def test_positive_list_parameters_by_hostgroup_name(self):
        """List all the parameters included in specific HostGroup by its name.

        @id: a2a01ca7-4dd2-4db6-a654-a632864998d9

        @assert: Parameters listed for specific HostGroup.

        @CaseLevel: Integration
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['override'], True)
        hostgroup = make_hostgroup({
            'environment-id': self.env['id'],
            'puppet-class-ids': self.puppet_class['id']
        })
        hostgroup_sc_params = HostGroup.sc_params({
            u'hostgroup': hostgroup['name']})
        self.assertGreater(len(hostgroup_sc_params), 0)
    def test_negative_validate_matcher_value_with_regex(self):
        """Error raised for matcher value not matching with regex.

        @id: b8b2f1c2-a20c-42d6-a687-79e6eee0268e

        @steps:

        1.  Override the parameter.
        2.  Create a matcher with value that doesn't match
        the regex of step 3.
        3.  Validate this value with regex validator type and rule.
        4.  Submit the change.

        @assert: Error raised for matcher value not matching with regex.
        """
        value = gen_string('numeric')
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=test.com',
            'value': gen_string('alpha')
        })
        with self.assertRaises(CLIReturnCodeError):
            SmartClassParameter.update({
                'id': sc_param_id,
                'default-value': value,
                'override': 1,
                'validator-type': 'regexp',
                'validator-rule': '[0-9]',
            })
        sc_param = SmartClassParameter.info({
            'puppet-class': self.puppet_class['name'],
            'id': sc_param_id,
        })
        self.assertNotEqual(sc_param['default-value'], value)
Example #34
0
    def test_positive_create_and_remove_matcher(self, module_puppet, module_sc_params):
        """Create and remove matcher for attribute in parameter.

        :id: 37fe299b-1e81-4faf-b1c3-2edfc3d53dc1

        :steps:

            1.  Override the parameter.
            2.  Set some default Value.
            3.  Create a matcher with all valid values.
            4.  Create matcher with valid attribute type, name and puppet
                default value.
            5.  Submit the change.
            6.  Remove the matcher created in step 1

        :expectedresults: The matcher has been created successfully.

        :CaseImportance: Medium
        """
        sc_param_id = module_sc_params['ids'].pop()
        value = gen_string('alpha')
        SmartClassParameter.update(
            {'id': sc_param_id, 'override': 1, 'override-value-order': 'is_virtual'}
        )
        SmartClassParameter.add_matcher(
            {'smart-class-parameter-id': sc_param_id, 'match': 'is_virtual=true', 'value': value}
        )
        sc_param = SmartClassParameter.info(
            {'puppet-class': module_puppet['class']['name'], 'id': sc_param_id}
        )
        assert sc_param['override-values']['values']['1']['match'] == 'is_virtual=true'
        assert sc_param['override-values']['values']['1']['value'] == value

        SmartClassParameter.remove_matcher(
            {
                'smart-class-parameter-id': sc_param_id,
                'id': sc_param['override-values']['values']['1']['id'],
            }
        )
        sc_param = SmartClassParameter.info(
            {'puppet-class': module_puppet['class']['name'], 'id': sc_param_id}
        )
        assert len(sc_param['override-values']['values']) == 0
Example #35
0
    def test_positive_update_hidden_value_in_parameter(self):
        """Update the hidden default value of parameter.

        @id: 8602abc9-80bd-412d-bf46-68a1c7f832e4

        @steps:

        1. Set the override flag for the parameter.
        2. Set some valid default value.
        3. Set 'Hidden Value' to true and submit.
        4. Now in hidden state, update the default value.

        @assert:

        1. The parameter default value is updated.
        2. The 'hidden value' displayed as true for that parameter.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        old_value = gen_string('alpha')
        new_value = gen_string('alpha')
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'default-value': old_value,
            'hidden-value': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['hidden-value?'], True)
        self.assertEqual(sc_param['default-value'], old_value)
        SmartClassParameter.update({
            'id': sc_param_id,
            'default-value': new_value,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['hidden-value?'], True)
        self.assertEqual(sc_param['default-value'], new_value)
Example #36
0
    def test_positive_list(self, module_org, module_location, module_puppet, module_sc_params):
        """List all the parameters included in specific elements.

        :id: 9fcfbe32-d388-435d-a629-6969a50a4243

        :expectedresults: Parameters listed for specific Environment
            (by name and id), Host (name, id), Hostgroup (name, id),
            and puppetclass (name)

        :CaseImportance: Medium
        """
        host = entities.Host(
            organization=module_org.id,
            location=module_location.id,
            environment=module_puppet['env']['name'],
        ).create()
        host.add_puppetclass(data={'puppetclass_id': module_puppet['class']['id']})
        hostgroup = make_hostgroup(
            {
                'environment-id': module_puppet['env']['id'],
                'puppet-class-ids': module_puppet['class']['id'],
            }
        )

        list_queries = [
            {'environment': module_puppet['env']['name']},
            {'environment-id': module_puppet['env']['id']},
            {'host': host.name},
            {'host-id': host.id},
            {'hostgroup': hostgroup["name"]},
            {'hostgroup-id': hostgroup["id"]},
            {'puppet-class': module_puppet['class']['name']},
        ]

        # override an example parameter
        sc_param_id = module_sc_params['ids'].pop()
        SmartClassParameter.update({'id': sc_param_id, 'override': 1})
        sc_param = SmartClassParameter.info(
            {'puppet-class': module_puppet['class']['name'], 'id': sc_param_id}
        )
        assert sc_param['override'] is True

        # check listing parameters for selected queries
        for query in list_queries:
            sc_params = SmartClassParameter.list(query)
            assert len(sc_params) > 0, f"Failed to list parameters for query: {query}"
            assert sc_param_id in [scp['id'] for scp in sc_params]
            # Check that only unique results are returned
            assert len(sc_params) == len(
                {scp['id'] for scp in sc_params}
            ), f'Not only unique results returned for query: {query}'
Example #37
0
    def test_positive_list(self):
        """List all the parameters included in specific elements.

        :id: 9fcfbe32-d388-435d-a629-6969a50a4243

        :expectedresults: Parameters listed for specific Environment
            (by name and id), Host (name, id), Hostgroup (name, id),
            and puppetclass (name)

        :CaseImportance: Medium
        """

        list_queries = [
            {'environment': self.env['name']},
            {'environment-id': self.env['id']},
            {'host': self.host.name},
            {'host-id': self.host.id},
            {'hostgroup': self.hostgroup["name"]},
            {'hostgroup-id': self.hostgroup["id"]},
            {'puppet-class': self.puppet_class['name']},
        ]

        # override an example parameter
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({'id': sc_param_id, 'override': 1})
        sc_param = SmartClassParameter.info(
            {'puppet-class': self.puppet_class['name'], 'id': sc_param_id}
        )
        self.assertEqual(sc_param['override'], True)

        # check listing parameters for selected queries
        for query in list_queries:
            with self.subTest(query):
                sc_params = SmartClassParameter.list(query)
                self.assertGreater(
                    len(sc_params), 0, "Failed to list parameters for query: {}".format(query)
                )

                self.assertIn(sc_param_id, [scp['id'] for scp in sc_params])

                # Check that only unique results are returned
                self.assertEqual(
                    len(sc_params),
                    len({scp['id'] for scp in sc_params}),
                    "Not only unique resutls returned for query: {}".format(query),
                )
Example #38
0
    def test_positive_update_parameter_type(self):
        """Positive Parameter Update for parameter types - Valid Value.

        Types - string, boolean, integer, real, array, hash, yaml, json

        @id: 19567098-2087-4633-bdb6-1450a233285c

        @steps:

        1.  Override the parameter.
        2.  Update the Key Type.
        3.  Provide a 'valid' default Value.
        3.  Submit the changes.

        @assert: Parameter Updated with a new type successfully.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        for data in valid_sc_parameters_data():
            with self.subTest(data):
                SmartClassParameter.update({
                    'parameter-type': data['sc_type'],
                    'default-value': data['value'],
                    'id': sc_param_id,
                    'override': 1,
                })
                sc_param = SmartClassParameter.info({
                    'puppet-class': 'ntp',
                    'id': sc_param_id,
                })
                if data['sc_type'] == 'boolean':
                    self.assertEqual(sc_param['default-value'],
                                     True if data['value'] == '1' else False)
                elif data['sc_type'] == 'array':
                    string_list = [
                        str(element) for element in sc_param['default-value']
                    ]
                    self.assertEqual(str(string_list), data['value'])
                elif data['sc_type'] == 'json':
                    self.assertEqual(
                        sc_param['default-value'],
                        json.loads(data['value'].replace("\\", "")))
                else:
                    self.assertEqual(sc_param['default-value'], data['value'])
Example #39
0
    def test_negative_update_parameter_type(self):
        """Negative Parameter Update for parameter types - Invalid Value.

        Types - string, boolean, integer, real, array, hash, yaml, json

        @id: 5c2c859a-8164-4733-8b41-d37f333656c7

        @steps:

        1.  Override the parameter.
        2.  Update the Key Type.
        3.  Enter an 'Invalid' default Value.
        3.  Submit the changes.

        @assert:

        1.  Parameter not updated with string type for invalid value.
        2.  Error raised for invalid default value.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        for test_data in invalid_sc_parameters_data():
            with self.subTest(test_data):
                with self.assertRaises(CLIReturnCodeError):
                    SmartClassParameter.update({
                        'parameter-type':
                        test_data['sc_type'],
                        'default-value':
                        test_data['value'],
                        'id':
                        sc_param_id,
                        'override':
                        1,
                    })
                sc_param = SmartClassParameter.info({
                    'puppet-class': 'ntp',
                    'id': sc_param_id,
                })
                self.assertNotEqual(sc_param['default-value'],
                                    test_data['value'])
Example #40
0
    def test_positive_list_parameters_by_host_name(self):
        """List all the parameters included in specific Host by its name.

        @id: a8165746-3480-4875-8931-b20ebec241dc

        @assert: Parameters listed for specific Host.

        @CaseLevel: Integration
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['override'], True)
        Host.update({u'name': self.host_name, u'puppet-classes': 'ntp'})
        host_sc_params_list = Host.sc_params({u'host': self.host_name})
        self.assertGreater(len(host_sc_params_list), 0)
Example #41
0
    def test_positive_validate_default_value_with_list(self, module_puppet,
                                                       module_sc_params):
        """Error not raised for default value in list and required

        :id: b03708e8-e597-40fb-bb24-a1ac87475846

        :steps:

            1.  Override the parameter.
            2.  Provide default value that matches the list of step 3.
            3.  Validate this value with list validator type and rule.
            4.  Submit the change.

        :expectedresults: Error not raised for default value in list.

        :customerscenario: true

        :BZ: 1830834

        :CaseImportance: Medium
        """
        sc_param_id = module_sc_params['ids'].pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'default-value': 'test',
            'override': 1,
            'validator-type': 'list',
            'validator-rule': '5, test',
            'required': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            module_puppet['class']['name'],
            'id':
            sc_param_id
        })
        assert sc_param['default-value'] == 'test'
        assert sc_param['validator']['type'] == 'list'
        assert sc_param['validator']['rule'] == '5, test'
Example #42
0
    def test_positive_create_matcher_puppet_default_value(
            self, module_puppet, module_sc_params):
        """Create matcher for attribute in parameter,
        Where Value is puppet default value.

        :id: c08fcf25-e5c7-411e-beed-3741a24496fd

        :steps:

            1.  Override the parameter.
            2.  Set some default Value.
            3.  Create matcher with valid attribute type, name and puppet
                default value.
            4.  Submit the change.

        :expectedresults: The matcher has been created successfully.

        :CaseImportance: Medium
        """
        sc_param_id = module_sc_params['ids'].pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'default-value': gen_string('alpha')
        })
        SmartClassParameter.add_matcher({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=test.com',
            'omit': 1
        })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            module_puppet['class']['name'],
            'id':
            sc_param_id
        })
        assert sc_param['override-values']['values']['1'][
            'match'] == 'domain=test.com'
Example #43
0
    def test_positive_list_parameters_by_host_id(self):
        """List all the parameters included in specific Host by its id.

        @id: 79050de6-b894-4a88-b155-32bf488b692c

        @assert: Parameters listed for specific Host.

        @CaseLevel: Integration
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['override'], True)
        Host.update({u'name': self.host_name, u'puppet-classes': 'ntp'})
        host_id = Host.info({u'name': self.host_name})['id']
        host_sc_params_list = Host.sc_params({u'host-id': host_id})
        self.assertGreater(len(host_sc_params_list), 0)
Example #44
0
    def test_positive_create_matcher_puppet_default_value(self):
        """Create matcher for attribute in parameter,
        Where Value is puppet default value.

        @id: c08fcf25-e5c7-411e-beed-3741a24496fd

        @steps:

        1.  Override the parameter.
        2.  Set some default Value.
        3.  Create matcher with valid attribute type, name and
        puppet default value.
        4.  Submit the change.

        @assert: The matcher has been created successfully.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        value = gen_string('alpha')
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'default-value': gen_string('alpha'),
        })
        SmartClassParameter.add_override_value({
            'smart-class-parameter-id': sc_param_id,
            'match': 'domain=test.com',
            'value': value,
            'use-puppet-default': 1
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['override-values']['values']['1']['match'],
                         'domain=test.com')
        self.assertEqual(sc_param['override-values']['values']['1']['value'],
                         value)
Example #45
0
    def test_positive_puppet_default(self):
        """On Override, Set Puppet Default Value.

        @id: 360be750-ee96-414c-ac04-b2762f77503a

        @steps:

        1.  Override the parameter.
        2.  Set puppet default value to 'Use Puppet Default'.
        3.  Submit the changes.

        @assert: Puppet Default Value applied on parameter.
        """
        sc_param_id = self.sc_params_ids_list.pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'use-puppet-default': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class': 'ntp',
            'id': sc_param_id,
        })
        self.assertEqual(sc_param['use-puppet-default'], 'true')
Example #46
0
    def test_negative_validate_default_value_with_list(self, module_puppet,
                                                       module_sc_params):
        """Error raised for default value not in list.

        :id: cdcafbea-612e-4b60-90de-fa0c76442bbe

        :steps:

            1.  Override the parameter.
            2.  Provide default value that doesn't matches the list of step 3.
            3.  Validate this value with list validator type and rule.
            4.  Submit the change.

        :expectedresults: Error raised for default value not in list.

        :customerscenario: true

        :CaseImportance: Medium
        """
        value = gen_string('alphanumeric')
        sc_param_id = module_sc_params['ids'].pop()
        with pytest.raises(CLIReturnCodeError):
            SmartClassParameter.update({
                'id': sc_param_id,
                'default-value': value,
                'override': 1,
                'validator-type': 'list',
                'validator-rule': '5, test',
            })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            module_puppet['class']['name'],
            'id':
            sc_param_id
        })
        assert sc_param['default-value'] != value
Example #47
0
    def test_positive_override(self, module_puppet, module_sc_params):
        """Override the Default Parameter value.

        :id: 25e34bac-084c-4b68-a082-822633e19f7e

        :steps:

            1.  Override the parameter.
            2.  Set the new valid Default Value.
            3.  Set puppet default value to 'Use Puppet Default'.
            4.  Submit the changes.

        :expectedresults: Parameter Value overridden with new value.

        :BZ: 1830834

        :customerscenario: true

        :CaseImportance: Medium
        """
        sc_param_id = module_sc_params['ids'].pop()
        value = gen_string('alpha')
        SmartClassParameter.update({
            'default-value': value,
            'omit': 1,
            'id': sc_param_id,
            'override': 1
        })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            module_puppet['class']['name'],
            'id':
            sc_param_id
        })
        assert sc_param['default-value'] == value
        assert sc_param['omit'] is True
Example #48
0
    def test_positive_test_hidden_parameter_value(self, module_puppet,
                                                  module_sc_params):
        """Unhide the default value of parameter.

        :id: 3daf662f-a0dd-469c-8088-262bfaa5246a

        :steps:

            1. Set the override flag for the parameter.
            2. Set some valid default value.
            3. Set 'Hidden Value' to true and submit.
            4. After hiding, set the 'Hidden Value' to false.
            5. Update the hidden value to empty value
            6. Unhide the variable

        :expectedresults:
            1. The 'hidden value' is corrctly created
            2. It is successfull updated
            3. It remains hidden when empty
            4. It is successfully unhidden

        :CaseImportance: Low
        """
        # Create with hidden value
        sc_param_id = module_sc_params['ids'].pop()
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'default-value': gen_string('alpha'),
            'hidden-value': 1,
        })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            module_puppet['class']['name'],
            'id':
            sc_param_id
        })
        assert sc_param['hidden-value?'] is True

        # Update to empty value
        SmartClassParameter.update({
            'id': sc_param_id,
            'override': 1,
            'hidden-value': 1,
            'default-value': ''
        })
        sc_param = SmartClassParameter.info({
            'puppet-class':
            module_puppet['class']['name'],
            'id':
            sc_param_id,
            'show-hidden':
            1
        })
        assert sc_param['default-value'] == ''
        assert sc_param['hidden-value?'] is True

        # Unhide
        SmartClassParameter.update({'id': sc_param_id, 'hidden-value': 0})
        sc_param = SmartClassParameter.info({
            'puppet-class':
            module_puppet['class']['name'],
            'id':
            sc_param_id
        })
        assert sc_param['default-value'] == ''
        assert sc_param['hidden-value?'] is False