Esempio n. 1
0
 def test_ssd_change_cardinality_intermediate(self):
     """
     This testcase is very similar to the one above. The only difference is
     that an entire subgraph containing a SSD role is removed (immediate
     inheritance relationship between "Role A" and "Role B").
     """
     ssd_set = RbacSsdSet.objects.get(id=1)
     ssd_set.cardinality=3
     self.assertRaises(ValidationError, ssd_set.save)
     
     self.assertEqual(functions.DeleteInheritance(self.role_a, self.role_b), True)
     ssd_set.save()
     
     self.assertRaises(ValidationError, functions.AddInheritance, self.role_a, self.role_b)
Esempio n. 2
0
 def test_ssd_change_cardinality_direct(self):
     """
     This time we are removing the immediate inheritance relationship
     between "Role D" and "Role SSD3", change the SSD cardinality to 3
     and try to establish the inheritance again (which should raise a
     ValidationError).
     """
     ssd_set = RbacSsdSet.objects.get(id=1)
     ssd_set.cardinality=3
     self.assertRaises(ValidationError, ssd_set.save)
     
     self.assertEqual(functions.DeleteInheritance(self.role_d, self.role_ssdthree), True)
     ssd_set.save()
     
     self.assertRaises(ValidationError, functions.AddInheritance, self.role_d, self.role_ssdthree)