예제 #1
0
파일: test_qacls.py 프로젝트: Qumulo/qacls
    def test_parse_ace_group_to_trustee(self):
        """
        ACE_DATA_RO = {
            "type": "QFS_ACE_TYPE_ALLOWED",
            "adgroupname": "data",
            "flags": INHERIT_ALL,
            "rights": RO
        }
        should become
        ACE_DATA_RO = {
            "type": "QFS_ACE_TYPE_ALLOWED",
            "trustee": "21474837589",
            "flags": INHERIT_ALL,
            "rights": RO
        }
        before being applied by set_acls()
        """
        ace_data_ro_with_groupname = {
            "type": "QFS_ACE_TYPE_ALLOWED",
            "adgroupname": "data",
            "flags": INHERIT_ALL,
            "rights": RO
        }

        ace_data_ro_target = {
            "type": "QFS_ACE_TYPE_ALLOWED",
            "trustee": "21474837589",
            "flags": INHERIT_ALL,
            "rights": RO
        }

        self.assertEqual(ace_data_ro_target,
                         qacls.parse_ace(ace_data_ro_with_groupname))
예제 #2
0
파일: test_qacls.py 프로젝트: Qumulo/qacls
 def test_parse_ace_nfsgroup_to_trustee(self):
     ace_data_ro_with_username = {
         "type": "QFS_ACE_TYPE_ALLOWED",
         "nfsgroupname": "production",
         "flags": INHERIT_ALL,
         "rights": RO
     }
     ace_data_ro_target = {
         "type": "QFS_ACE_TYPE_ALLOWED",
         "trustee": "17179879186",
         "flags": INHERIT_ALL,
         "rights": RO
     }
     self.assertEqual(ace_data_ro_target,
                      qacls.parse_ace(ace_data_ro_with_username))
예제 #3
0
파일: test_qacls.py 프로젝트: Qumulo/qacls
 def test_parse_ace_nfsuser_to_trustee(self):
     ace_data_ro_with_username = {
         "type": "QFS_ACE_TYPE_ALLOWED",
         "nfsusername": "******",
         "flags": INHERIT_ALL,
         "rights": RO
     }
     ace_data_ro_target = {
         "type": "QFS_ACE_TYPE_ALLOWED",
         "trustee": "12884911888",
         "flags": INHERIT_ALL,
         "rights": RO
     }
     self.assertEqual(ace_data_ro_target,
                      qacls.parse_ace(ace_data_ro_with_username))
예제 #4
0
파일: test_qacls.py 프로젝트: Qumulo/qacls
 def test_parse_ace_user_to_trustee(self):
     ace_data_ro_with_username = {
         "type": "QFS_ACE_TYPE_ALLOWED",
         "adusername": "******",
         "flags": INHERIT_ALL,
         "rights": RO
     }
     ace_data_ro_target = {
         "type": "QFS_ACE_TYPE_ALLOWED",
         "trustee": "21474836980",
         "flags": INHERIT_ALL,
         "rights": RO
     }
     self.assertEqual(ace_data_ro_target,
                      qacls.parse_ace(ace_data_ro_with_username))
예제 #5
0
파일: test_qacls.py 프로젝트: Qumulo/qacls
 def test_parse_ace_groupname_to_trustee(self):
     ace_data_ro_with_groupname = {
         "type": "QFS_ACE_TYPE_ALLOWED",
         "groupname": "production",
         "flags": INHERIT_ALL,
         "rights": RO
     }
     ace_data_ro_target = [
         {
             "type": "QFS_ACE_TYPE_ALLOWED",
             "trustee": "17179879186",
             "flags": INHERIT_ALL,
             "rights": RO
         },
         {
             "type": "QFS_ACE_TYPE_ALLOWED",
             "trustee": "21474837590",
             "flags": INHERIT_ALL,
             "rights": RO
         }
     ]
     result = qacls.parse_ace(ace_data_ro_with_groupname)
     print result
     self.assertEqual(ace_data_ro_target, result)