Example #1
0
 def test_0_automountlocation_add(self):
     """
     Test adding a location `xmlrpc.automountlocation_add` method.
     """
     ret = self.failsafe_add(api.Object.automountlocation, self.locname)
     entry = ret["result"]
     assert_attr_equal(entry, "cn", self.locname)
Example #2
0
 def test_2_automountkey_add(self):
     """
     Test adding a key using `xmlrpc.automountkey_add` method.
     """
     res = api.Command["automountkey_add"](self.locname, self.mapname, **self.key_kw2)["result"]
     assert res
     assert_attr_equal(res, "automountkey", self.keyname2)
Example #3
0
 def test_9_pwpolicy_mod(self):
     """
     Test the `xmlrpc.pwpolicy_mod` method.
     """
     entry = api.Command['pwpolicy_mod'](self.group,
                                         krbminpwdlife=50)['result']
     assert_attr_equal(entry, 'krbminpwdlife', '50')
 def test_1_automountmap_add_indirect(self):
     """
     Test adding an indirect map with default parent.
     """
     res = api.Command['automountmap_add_indirect'](self.locname, self.mapname, **self.map_kw)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
 def test_2_automountmap_show(self):
     """
     Test the `xmlrpc.automountmap_show` method.
     """
     res = api.Command['automountmap_show'](self.locname, self.mapname, raw=True)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
Example #6
0
 def test_0_automountlocation_add(self):
     """
     Test adding a location.
     """
     res = api.Command["automountlocation_add"](self.locname, raw=True)["result"]
     assert res
     assert_attr_equal(res, "cn", self.locname)
Example #7
0
 def test_2_automountmap_show(self):
     """
     Test the `xmlrpc.automountmap_show` method.
     """
     res = api.Command["automountmap_show"](self.locname, self.mapname, raw=True)["result"]
     assert res
     assert_attr_equal(res, "automountmapname", self.mapname)
 def test_0_automountlocation_add(self):
     """
     Test adding a location.
     """
     res = api.Command['automountlocation_add'](self.locname, raw=True)['result']
     assert res
     assert_attr_equal(res, 'cn', self.locname)
 def test_1_automountmap_add(self):
     """
     Test adding a map `xmlrpc.automountmap_add` method.
     """
     res = api.Command['automountmap_add'](self.locname, **self.map_kw)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
Example #10
0
 def test_1_automountmap_add_indirect(self):
     """
     Test adding an indirect map with default parent.
     """
     res = api.Command['automountmap_add_indirect'](self.locname, self.mapname, **self.map_kw)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
Example #11
0
 def test_2_sudorule_show(self):
     """
     Test displaying a Sudo rule using `xmlrpc.sudorule_show`.
     """
     entry = api.Command['sudorule_show'](self.rule_name)['result']
     assert_attr_equal(entry, 'cn', self.rule_name)
     assert_attr_equal(entry, 'description', self.rule_desc)
Example #12
0
 def test_0_automountlocation_add(self):
     """
     Test adding a location.
     """
     res = api.Command['automountlocation_add'](self.locname, raw=True)['result']
     assert res
     assert_attr_equal(res, 'cn', self.locname)
Example #13
0
 def test_1_automountmap_add_direct(self):
     """
     Test adding a second direct map with a different info
     """
     res = api.Command['automountmap_add_indirect'](self.locname, self.mapname, **self.direct_kw)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
Example #14
0
 def test_2_automountmap_show(self):
     """
     Test the `xmlrpc.automountmap_show` method.
     """
     res = api.Command['automountmap_show'](self.locname, self.mapname, raw=True)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
Example #15
0
 def test_3_automountkey_add(self):
     """
     Test adding a key using `xmlrpc.automountkey_add` method.
     """
     res = api.Command['automountkey_add'](self.locname, self.mapname, **self.key_kw)['result']
     assert res
     assert_attr_equal(res, 'automountkey', self.keyname)
Example #16
0
 def test_1_automountmap_add_indirect(self):
     """
     Test adding an indirect map.
     """
     res = api.Command["automountmap_add_indirect"](self.locname, self.mapname, **self.map_kw)["result"]
     assert res
     assert_attr_equal(res, "automountmapname", self.mapname)
Example #17
0
 def test_1_automountmap_add_direct(self):
     """
     Test adding a second direct map with a different info
     """
     res = api.Command['automountmap_add_indirect'](self.locname, self.mapname, **self.direct_kw)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
Example #18
0
 def test_3_automountkey_add(self):
     """
     Test adding a key using `xmlrpc.automountkey_add` method.
     """
     res = api.Command['automountkey_add'](self.locname, self.mapname, **self.key_kw)['result']
     assert res
     assert_attr_equal(res, 'automountkey', self.keyname)
Example #19
0
 def test_1_automountmap_add(self):
     """
     Test adding a map `xmlrpc.automountmap_add` method.
     """
     res = api.Command['automountmap_add'](self.locname, **self.map_kw)['result']
     assert res
     assert_attr_equal(res, 'automountmapname', self.mapname)
Example #20
0
 def test_2_sudorule_show(self):
     """
     Test displaying a Sudo rule using `xmlrpc.sudorule_show`.
     """
     entry = api.Command['sudorule_show'](self.rule_name)['result']
     assert_attr_equal(entry, 'cn', self.rule_name)
     assert_attr_equal(entry, 'description', self.rule_desc)
Example #21
0
 def test_0_automountlocation_add(self):
     """
     Test adding a location `xmlrpc.automountlocation_add` method.
     """
     ret = self.failsafe_add(api.Object.automountlocation, self.locname)
     entry = ret['result']
     assert_attr_equal(entry, 'cn', self.locname)
Example #22
0
 def test_a_sudorule_show_hostgroup(self):
     """
     Test showing hostgroup to verify Sudo rule membership
     `xmlrpc.hostgroup_show`.
     """
     ret = api.Command['hostgroup_show'](self.test_hostgroup, all=True)
     entry = ret['result']
     assert_attr_equal(entry, 'memberof_sudorule', self.rule_name)
Example #23
0
 def test_2_automountkey_show(self):
     """
     Test the `xmlrpc.automountkey_show` method with default parent.
     """
     showkey_kw = {'automountkey': self.keyname, 'automountinformation': self.mapname, 'raw': True}
     res = api.Command['automountkey_show'](self.locname, self.parentmap, **showkey_kw)['result']
     assert res
     assert_attr_equal(res, 'automountkey', self.keyname)
Example #24
0
 def test_9_a_show_user(self):
     """
     Test showing a user to verify Sudo rule membership
     `xmlrpc.user_show`.
     """
     ret = api.Command['user_show'](self.test_user, all=True)
     entry = ret['result']
     assert_attr_equal(entry, 'memberof_sudorule', self.rule_name)
Example #25
0
 def test_2_automountkey_show(self):
     """
     Test the `xmlrpc.automountkey_show` method with default parent.
     """
     showkey_kw = {"automountkey": self.keyname, "automountinformation": self.mapname, "raw": True}
     res = api.Command["automountkey_show"](self.locname, self.parentmap, **showkey_kw)["result"]
     assert res
     assert_attr_equal(res, "automountkey", self.keyname)
Example #26
0
 def test_a_automountmap_mod(self):
     """
     Test the `xmlrpc.automountmap_mod` method.
     """
     mod_kw = {'description': u'new description'}
     res = api.Command['automountmap_mod'](self.locname, self.mapname, **mod_kw)['result']
     assert res
     assert_attr_equal(res, 'description', 'new description')
Example #27
0
 def test_3_sudorule_mod(self):
     """
     Test modifying a Sudo rule using `xmlrpc.sudorule_mod`.
     """
     ret = api.Command['sudorule_mod'](self.rule_name,
                                       description=self.rule_desc_mod)
     entry = ret['result']
     assert_attr_equal(entry, 'description', self.rule_desc_mod)
Example #28
0
 def test_6_automountmap_find(self):
     """
     Test the `xmlrpc.automountmap_find` method.
     """
     res = api.Command['automountmap_find'](self.locname,
                                            self.mapname,
                                            raw=True)['result']
     assert_attr_equal(res[0], 'automountmapname', self.mapname)
Example #29
0
 def test_a1_automountmap_mod(self):
     """
     Test the `xmlrpc.automountmap_mod` method.
     """
     mod_kw = {"description": u"new description"}
     res = api.Command["automountmap_mod"](self.locname, self.mapname, **mod_kw)["result"]
     assert res
     assert_attr_equal(res, "description", "new description")
Example #30
0
 def test_a_automountmap_mod(self):
     """
     Test the `xmlrpc.automountmap_mod` method.
     """
     mod_kw = {'description': u'new description'}
     res = api.Command['automountmap_mod'](self.locname, self.mapname, **mod_kw)['result']
     assert res
     assert_attr_equal(res, 'description', 'new description')
Example #31
0
 def test_a_hbacrule_show_host(self):
     """
     Test showing host to verify HBAC rule membership
     `xmlrpc.host_show`.
     """
     ret = api.Command['host_show'](self.test_host, all=True)
     entry = ret['result']
     assert_attr_equal(entry, 'memberof_hbacrule', self.rule_name)
Example #32
0
 def test_d_hbacrule_disable(self):
     """
     Test disabling HBAC rule using `xmlrpc.hbacrule_disable`.
     """
     assert api.Command['hbacrule_disable'](self.rule_name)['result'] is True
     entry = api.Command['hbacrule_show'](self.rule_name)['result']
     # FIXME: Should this be 'disabled' or 'FALSE'?
     assert_attr_equal(entry, 'ipaenabledflag', 'FALSE')
Example #33
0
 def test_2_automountkey_show(self):
     """
     Test the `xmlrpc.automountkey_show` method with default parent.
     """
     showkey_kw = {'automountkey': self.keyname, 'automountinformation': self.mapname, 'raw': True}
     res = api.Command['automountkey_show'](self.locname, self.parentmap, **showkey_kw)['result']
     assert res
     assert_attr_equal(res, 'automountkey', self.keyname)
Example #34
0
 def test_9_b_show_group(self):
     """
     Test showing a group to verify HBAC rule membership
     `xmlrpc.group_show`.
     """
     ret = api.Command['group_show'](self.test_group, all=True)
     entry = ret['result']
     assert_attr_equal(entry, 'memberof_hbacrule', self.rule_name)
Example #35
0
 def test_a_sudorule_show_hostgroup(self):
     """
     Test showing hostgroup to verify Sudo rule membership
     `xmlrpc.hostgroup_show`.
     """
     ret = api.Command['hostgroup_show'](self.test_hostgroup, all=True)
     entry = ret['result']
     assert_attr_equal(entry, 'memberof_sudorule', self.rule_name)
Example #36
0
 def test_9_a_show_user(self):
     """
     Test showing a user to verify Sudo rule membership
     `xmlrpc.user_show`.
     """
     ret = api.Command['user_show'](self.test_user, all=True)
     entry = ret['result']
     assert_attr_equal(entry, 'memberof_sudorule', self.rule_name)
Example #37
0
 def test_e_hbacrule_enabled(self):
     """
     Test enabling HBAC rule using `xmlrpc.hbacrule_enable`.
     """
     assert api.Command['hbacrule_enable'](self.rule_name)['result'] is True
     # check it's really enabled
     entry = api.Command['hbacrule_show'](self.rule_name)['result']
      # FIXME: Should this be 'enabled' or 'TRUE'?
     assert_attr_equal(entry, 'ipaenabledflag', 'TRUE')
Example #38
0
 def test_8_automountkey_find(self):
     """
     Test the `xmlrpc.automountkey_find` method.
     """
     res = api.Command['automountkey_find'](self.locname, self.mapname, raw=True)['result']
     assert res
     assert len(res) == 2
     assert_attr_equal(res[0], 'automountkey', self.keyname)
     assert_attr_equal(res[0], 'automountinformation', self.info)
Example #39
0
 def test_8_automountkey_find(self):
     """
     Test the `xmlrpc.automountkey_find` method.
     """
     res = api.Command['automountkey_find'](self.locname, self.mapname, raw=True)['result']
     assert res
     assert len(res) == 2
     assert_attr_equal(res[0], 'automountkey', self.keyname)
     assert_attr_equal(res[0], 'automountinformation', self.info)
Example #40
0
 def test_ea_hbacrule_disable_setattr(self):
     """
     Test disabling HBAC rule using setattr
     """
     command_result = api.Command['hbacrule_mod'](
         self.rule_name, setattr=u'ipaenabledflag=false')
     assert command_result['result']['ipaenabledflag'] == (u'FALSE',)
     entry = api.Command['hbacrule_show'](self.rule_name)['result']
     assert_attr_equal(entry, 'ipaenabledflag', 'FALSE')
Example #41
0
 def test_a_sudorule_add_option(self):
     """
     Test adding an option to Sudo rule using
     `xmlrpc.sudorule_add_option`.
     """
     ret = api.Command['sudorule_add_option'](self.rule_name,
                                              ipasudoopt=self.test_option)
     entry = ret['result']
     assert_attr_equal(entry, 'ipasudoopt', self.test_option)
Example #42
0
 def test_2a_automountmap_add_indirect(self):
     """
     Test adding an indirect map with default parent.
     """
     res = api.Command["automountmap_add_indirect"](
         self.locname, u"auto.direct2", parentmap=self.mapname, **self.map_kw2
     )["result"]
     assert res
     assert_attr_equal(res, "automountmapname", self.mapname2)
Example #43
0
 def test_k_2_sudorule_referential_integrity(self):
     """
     Test that links in HBAC rule were removed by referential integrity plugin
     """
     entry = api.Command['hbacrule_show'](self.rule_name)['result']
     assert_attr_equal(entry, 'cn', self.rule_name)
     assert 'sourcehost_host' not in entry
     assert 'sourcehost_hostgroup' not in entry
     assert 'memberservice_hbacsvc' not in entry
Example #44
0
 def test_3_sudorule_mod(self):
     """
     Test modifying a Sudo rule using `xmlrpc.sudorule_mod`.
     """
     ret = api.Command['sudorule_mod'](
         self.rule_name, description=self.rule_desc_mod
     )
     entry = ret['result']
     assert_attr_equal(entry, 'description', self.rule_desc_mod)
Example #45
0
    def test_8_pwpolicy_mod(self):
        """
        Test the `xmlrpc.pwpolicy_mod` method for global policy.
        """
        entry = api.Command['pwpolicy_mod'](krbminpwdlife=50)['result']
        assert_attr_equal(entry, 'krbminpwdlife', '50')

        # Great, now change it back
        entry = api.Command['pwpolicy_mod'](krbminpwdlife=1)['result']
        assert_attr_equal(entry, 'krbminpwdlife', '1')
Example #46
0
 def test_1_user_add(self):
     """
     Create a test user
     """
     entry = api.Command['user_add'](**self.kw)['result']
     assert_attr_equal(entry, 'givenname', self.givenname)
     assert_attr_equal(entry, 'sn', self.sn)
     assert_attr_equal(entry, 'uid', self.uid)
     assert_attr_equal(entry, 'homedirectory', self.home)
     assert_attr_equal(entry, 'objectclass', 'ipaobject')
Example #47
0
 def test_9_automountkey_mod(self):
     """
     Test the `xmlrpc.automountkey_mod` method.
     """
     self.key_kw['newautomountinformation'] = self.newinfo
     self.key_kw['rename'] = self.keyname_rename
     res = api.Command['automountkey_mod'](self.locname, self.mapname, **self.key_kw)['result']
     assert res
     assert_attr_equal(res, 'automountinformation', self.newinfo)
     assert_attr_equal(res, 'automountkey', self.keyname_rename)
Example #48
0
 def test_a_sudorule_add_option(self):
     """
     Test adding an option to Sudo rule using
     `xmlrpc.sudorule_add_option`.
     """
     ret = api.Command['sudorule_add_option'](
         self.rule_name, ipasudoopt=self.test_option
     )
     entry = ret['result']
     assert_attr_equal(entry, 'ipasudoopt', self.test_option)
Example #49
0
 def test_9_automountkey_mod(self):
     """
     Test the `xmlrpc.automountkey_mod` method.
     """
     self.key_kw['newautomountinformation'] = self.newinfo
     self.key_kw['rename'] = self.keyname_rename
     res = api.Command['automountkey_mod'](self.locname, self.mapname, **self.key_kw)['result']
     assert res
     assert_attr_equal(res, 'automountinformation', self.newinfo)
     assert_attr_equal(res, 'automountkey', self.keyname_rename)
Example #50
0
 def test_eb_hbacrule_enable_setattr(self):
     """
     Test enabling HBAC rule using setattr
     """
     command_result = api.Command['hbacrule_mod'](
         self.rule_name, setattr=u'ipaenabledflag=1')
     assert command_result['result']['ipaenabledflag'] == (u'TRUE',)
     # check it's really enabled
     entry = api.Command['hbacrule_show'](self.rule_name)['result']
     assert_attr_equal(entry, 'ipaenabledflag', 'TRUE')
Example #51
0
 def test_6_sudorule_find(self):
     """
     Test searching for Sudo rules using `xmlrpc.sudorule_find`.
     """
     ret = api.Command['sudorule_find'](cn=self.rule_name,
                                        description=self.rule_desc_mod)
     assert ret['truncated'] is False
     entries = ret['result']
     assert_attr_equal(entries[0], 'cn', self.rule_name)
     assert_attr_equal(entries[0], 'description', self.rule_desc_mod)
Example #52
0
 def test_7_pwpolicy_show(self):
     """
     Test the `xmlrpc.pwpolicy_show` method.
     """
     entry = api.Command['pwpolicy_show'](self.group)['result']
     assert_attr_equal(entry, 'krbminpwdlife', '30')
     assert_attr_equal(entry, 'krbmaxpwdlife', '40')
     assert_attr_equal(entry, 'krbpwdhistorylength', '5')
     assert_attr_equal(entry, 'krbpwdminlength', '6')
     assert_attr_equal(entry, 'cospriority', '1')
Example #53
0
    def test_c_automountlocation_del(self):
        """
        Test the `xmlrpc.automountlocation_del` method.
        """
        res = api.Command['automountlocation_del'](self.locname)['result']
        assert res
        assert_attr_equal(res, 'failed', '')

        # Verify that it is gone
        with assert_raises(errors.NotFound):
            api.Command['automountlocation_show'](self.locname)
Example #54
0
 def test_a_sudorule_add_externalhost(self):
     """
     Test adding an external host to Sudo rule using
     `xmlrpc.sudorule_add_host`.
     """
     ret = api.Command['sudorule_add_host'](self.rule_name,
                                            host=self.test_external_host)
     assert ret['completed'] == 1
     failed = ret['failed']
     entry = ret['result']
     assert_attr_equal(entry, 'externalhost', self.test_external_host)
Example #55
0
    def test_3_automountkey_del(self):
        """
        Remove the indirect key /home.
        """
        res = api.Command['automountkey_del'](self.locname, self.parentmap, **self.key_kw)['result']
        assert res
        assert_attr_equal(res, 'failed', '')

        # Verify that it is gone
        with assert_raises(errors.NotFound):
            api.Command['automountkey_show'](self.locname, self.parentmap, **self.key_kw)
Example #56
0
    def test_4_automountmap_del(self):
        """
        Remove the indirect map for auto.home.
        """
        res = api.Command['automountmap_del'](self.locname, self.mapname)['result']
        assert res
        assert_attr_equal(res, 'failed', '')

        # Verify that it is gone
        with assert_raises(errors.NotFound):
            api.Command['automountmap_show'](self.locname, self.mapname)
Example #57
0
    def test_5_automountlocation_del(self):
        """
        Remove the location.
        """
        res = api.Command['automountlocation_del'](self.locname)['result']
        assert res
        assert_attr_equal(res, 'failed', '')

        # Verity that it is gone
        with assert_raises(errors.NotFound):
            api.Command['automountlocation_show'](self.locname)
Example #58
0
 def test_0_sudorule_add(self):
     """
     Test adding a new Sudo rule using `xmlrpc.sudorule_add`.
     """
     ret = self.failsafe_add(
         api.Object.sudorule,
         self.rule_name,
         description=self.rule_desc,
     )
     entry = ret['result']
     assert_attr_equal(entry, 'cn', self.rule_name)
     assert_attr_equal(entry, 'description', self.rule_desc)
Example #59
0
 def test_a_sudorule_add_runasexternalgroup(self):
     """
     Test adding an external runasgroup to Sudo rule using
     `xmlrpc.sudorule_add_runasgroup`.
     """
     ret = api.Command['sudorule_add_runasgroup'](
         self.rule_name, group=self.test_external_group)
     assert ret['completed'] == 1
     failed = ret['failed']
     entry = ret['result']
     assert_attr_equal(entry, 'ipasudorunasextgroup',
                       self.test_external_group)
Example #60
0
 def test_a_sudorule_add_runasexternaluser(self):
     """
     Test adding an external runasuser to Sudo rule using
     `xmlrpc.sudorule_add_runasuser`.
     """
     ret = api.Command['sudorule_add_runasuser'](
         self.rule_name, user=self.test_external_user)
     assert ret['completed'] == 1
     failed = ret['failed']
     entry = ret['result']
     assert_attr_equal(entry, 'ipasudorunasextuser',
                       self.test_external_user)