Пример #1
0
	def setUp(self):
		for testfile in ["restauth-test", "restauth-test-group", "restauth-test-group-unknown", "restauth-test-domain"]:
			self.assertTrue(os.path.exists("/etc/pam.d/%s" % testfile), """
			Missing PAM service configurations exist in /etc/pam.d/.
			See this test class's documentation for how to create them.
			""")
	
		self.conn = common.RestAuthConnection("http://[::1]:8000", "vowi", "vowi")
		self.user1 = restauth_user.create(self.conn, "user1", "password1")
		self.user2 = restauth_user.create(self.conn, "user2", "password2")
		self.user3 = restauth_user.create(self.conn, "user3", "password3")
		self.group = group.create(self.conn, "testgroup")
		self.group.add_user(self.user1)
Пример #2
0
	print( 'get_property returned deleted property' )
	sys.exit(1)
except ResourceNotFound:
	pass

props = user1.get_properties()
if 'skin' in props:
	print( 'get_properties returned deleted property' )
	sys.exit(1)
print( 'Ok.' )

#####################
### GROUP TESTING ###
#####################
print( 'Creating test groups... ', end='' )
group0 = group.create( conn, 'group0' )
group1 = group.create( conn, 'group1' )
group2 = group.create( conn, 'group2' )
group3 = group.create( conn, 'group3' )
group4 = group.create( conn, 'group4' )
group5 = group.create( conn, 'group5' )
group6 = group.create( conn, 'group6' )
group7 = group.create( conn, 'group7' )
group8 = group.create( conn, 'group8' )
group9 = group.create( conn, 'group9' )
print( 'Ok.' )

print( 'Try to create already existing group... ', end='' )
try:
	group0 = group.create( conn, 'group0' )
	print( 'Error: Successfully created existing group' )