Esempio n. 1
0
 def test_010_verify_special_value(self):
     self.assertTrue(
         qubespolicy.verify_special_value('$tag:tag', for_target=False))
     self.assertTrue(
         qubespolicy.verify_special_value('$tag:other-tag',
                                          for_target=False))
     self.assertTrue(
         qubespolicy.verify_special_value('$type:AppVM', for_target=False))
     self.assertFalse(
         qubespolicy.verify_special_value('$default', for_target=False))
     self.assertFalse(
         qubespolicy.verify_special_value('$dispvm', for_target=False))
     self.assertFalse(
         qubespolicy.verify_special_value('$dispvm:some-vm',
                                          for_target=False))
     self.assertFalse(
         qubespolicy.verify_special_value('$invalid', for_target=False))
     self.assertFalse(
         qubespolicy.verify_special_value('vm-name', for_target=False))
     self.assertFalse(
         qubespolicy.verify_special_value('$tag:', for_target=False))
     self.assertFalse(
         qubespolicy.verify_special_value('$type:', for_target=False))
Esempio n. 2
0
 def test_010_verify_special_value(self):
     self.assertTrue(qubespolicy.verify_special_value('@tag:tag',
         for_target=False))
     self.assertTrue(qubespolicy.verify_special_value('@tag:other-tag',
         for_target=False))
     self.assertTrue(qubespolicy.verify_special_value('@type:AppVM',
         for_target=False))
     self.assertTrue(qubespolicy.verify_special_value('@adminvm',
         for_target=False))
     self.assertTrue(qubespolicy.verify_special_value('@dispvm:some-vm',
         for_target=True))
     self.assertTrue(qubespolicy.verify_special_value('@dispvm:@tag:tag1',
         for_target=True))
     self.assertFalse(qubespolicy.verify_special_value('@default',
         for_target=False))
     self.assertFalse(qubespolicy.verify_special_value('@dispvm',
         for_target=False))
     self.assertFalse(qubespolicy.verify_special_value('@dispvm:some-vm',
         for_target=False))
     self.assertFalse(qubespolicy.verify_special_value('@dispvm:@tag:tag1',
         for_target=False))
     self.assertFalse(qubespolicy.verify_special_value('@invalid',
         for_target=False))
     self.assertFalse(qubespolicy.verify_special_value('vm-name',
         for_target=False))
     self.assertFalse(qubespolicy.verify_special_value('@tag:',
         for_target=False))
     self.assertFalse(qubespolicy.verify_special_value('@type:',
         for_target=False))