예제 #1
0
    def testModeChange(self):

        host = test_utils.CreateSantaHost(
            primary_user=user_utils.EmailToUsername(self.user.key.id()),
            client_mode=MONITOR)
        role_syncing._ChangeModeForHosts(LOCKDOWN, [self.user.key])

        host = host.key.get()
        self.assertEqual(LOCKDOWN, host.client_mode)
예제 #2
0
    def testClientModeLockOnHonored(self):

        host = test_utils.CreateSantaHost(
            primary_user=user_utils.EmailToUsername(self.user.key.id()),
            client_mode=MONITOR,
            client_mode_lock=True)
        role_syncing._ChangeModeForHosts(LOCKDOWN, [self.user.key])

        host = host.key.get()
        self.assertTrue(host.client_mode_lock)
        self.assertEqual(MONITOR, host.client_mode)
예제 #3
0
    def testNoHosts(self):

        role_syncing._ChangeModeForHosts(LOCKDOWN, [self.user.key])