cloud_policy_manager_browsertest.cc revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved. 22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file. 42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/command_line.h" 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/memory/scoped_ptr.h" 72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/run_loop.h" 82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/browser_process.h" 92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/browser_policy_connector.h" 102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/cloud/cloud_policy_client.h" 112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/cloud/mock_cloud_policy_client.h" 122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/cloud/proto/device_management_backend.pb.h" 132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/cloud/test_request_interceptor.h" 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/test_utils.h" 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/profiles/profile.h" 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/ui/browser.h" 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/common/chrome_switches.h" 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/test/base/in_process_browser_test.h" 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "net/base/net_errors.h" 202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "testing/gmock/include/gmock/gmock.h" 212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "testing/gtest/include/gtest/gtest.h" 222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if defined(OS_CHROMEOS) 242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" 252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#else 262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" 272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/signin/signin_manager.h" 292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/signin/signin_manager_factory.h" 302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif 312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)using testing::AnyNumber; 332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)using testing::InvokeWithoutArgs; 342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)using testing::Mock; 352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)using testing::_; 362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace em = enterprise_management; 382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace policy { 402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tests the cloud policy stack using a URLRequestJobFactory::ProtocolHandler 422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// to intercept requests and produce canned responses. 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class CloudPolicyManagerTest : public InProcessBrowserTest { 442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) protected: 452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) CloudPolicyManagerTest() {} 462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual ~CloudPolicyManagerTest() {} 472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) CommandLine* command_line = CommandLine::ForCurrentProcess(); 502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) command_line->AppendSwitchASCII(switches::kDeviceManagementUrl, 512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) "http://localhost"); 522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void SetUpOnMainThread() OVERRIDE { 552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service())) 562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) << "Pre-existing policies in this machine will make this test fail."; 572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) interceptor_.reset(new TestRequestInterceptor("localhost")); 592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) BrowserPolicyConnector* connector = 612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) g_browser_process->browser_policy_connector(); 622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) connector->ScheduleServiceInitialization(0); 632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if !defined(OS_CHROMEOS) 652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass 662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // the username to the UserCloudPolicyValidator. 672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) SigninManager* signin_manager = 682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) SigninManagerFactory::GetForProfile(browser()->profile()); 692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_TRUE(signin_manager); 702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) signin_manager->SetAuthenticatedUsername("user@example.com"); 712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) UserCloudPolicyManager* policy_manager = 732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) UserCloudPolicyManagerFactory::GetForProfile(browser()->profile()); 742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_TRUE(policy_manager); 752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) policy_manager->Connect(g_browser_process->local_state(), 762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) UserCloudPolicyManager::CreateCloudPolicyClient( 772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) connector->device_management_service()).Pass()); 782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif 792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void CleanUpOnMainThread() OVERRIDE { 822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Verify that all the expected requests were handled. 832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_EQ(0u, interceptor_->GetPendingSize()); 842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) interceptor_.reset(); 862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if defined(OS_CHROMEOS) 892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) UserCloudPolicyManagerChromeOS* policy_manager() { 902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return g_browser_process->browser_policy_connector()-> 912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) GetUserCloudPolicyManager(); 922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#else 942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) UserCloudPolicyManager* policy_manager() { 952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return UserCloudPolicyManagerFactory::GetForProfile(browser()->profile()); 962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif // defined(OS_CHROMEOS) 982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Register the client of the policy_manager() using a bogus auth token, and 1002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // returns once the registration gets a result back. 1012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) void Register() { 1022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_TRUE(policy_manager()); 1032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_TRUE(policy_manager()->core()->client()); 1042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) base::RunLoop run_loop; 1062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) MockCloudPolicyClientObserver observer; 1072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_CALL(observer, OnRegistrationStateChanged(_)) 1082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) .Times(AnyNumber()) 1092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) .WillRepeatedly(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 1102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_CALL(observer, OnClientError(_)) 1112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) .Times(AnyNumber()) 1122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) .WillRepeatedly(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 1132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) policy_manager()->core()->client()->AddObserver(&observer); 1142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Give a bogus OAuth token to the |policy_manager|. This should make its 1162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // CloudPolicyClient fetch the DMToken. 1172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) policy_manager()->RegisterClient("bogus"); 1182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) run_loop.Run(); 1192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) Mock::VerifyAndClearExpectations(&observer); 1202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) policy_manager()->core()->client()->RemoveObserver(&observer); 1212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 1222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) scoped_ptr<TestRequestInterceptor> interceptor_; 1242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}; 1252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IN_PROC_BROWSER_TEST_F(CloudPolicyManagerTest, Register) { 1272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Accept one register request. The initial request should not include the 1282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // reregister flag. 1292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) em::DeviceRegisterRequest::Type expected_type = 1302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if defined(OS_CHROMEOS) 1312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) em::DeviceRegisterRequest::USER; 1322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#else 1332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) em::DeviceRegisterRequest::BROWSER; 1342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif 1352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const bool expect_reregister = false; 1362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) interceptor_->PushJobCallback( 1372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); 1382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); 1402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_NO_FATAL_FAILURE(Register()); 1412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); 1422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 1432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IN_PROC_BROWSER_TEST_F(CloudPolicyManagerTest, RegisterFails) { 1452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // The interceptor makes all requests fail by default; this will trigger 1462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // an OnClientError() call on the observer. 1472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); 1482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_NO_FATAL_FAILURE(Register()); 1492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); 1502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 1512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IN_PROC_BROWSER_TEST_F(CloudPolicyManagerTest, RegisterFailsWithRetries) { 1532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Fail 4 times with ERR_NETWORK_CHANGED; the first 3 will trigger a retry, 1542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // the last one will forward the error to the client and unblock the 1552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // register process. 1562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) for (int i = 0; i < 4; ++i) { 1572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) interceptor_->PushJobCallback( 1582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) TestRequestInterceptor::ErrorJob(net::ERR_NETWORK_CHANGED)); 1592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 1602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); 1622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_NO_FATAL_FAILURE(Register()); 1632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); 1642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 1652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IN_PROC_BROWSER_TEST_F(CloudPolicyManagerTest, RegisterWithRetry) { 1672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Accept one register request after failing once. The retry request should 1682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // set the reregister flag. 1692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) interceptor_->PushJobCallback( 1702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) TestRequestInterceptor::ErrorJob(net::ERR_NETWORK_CHANGED)); 1712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) em::DeviceRegisterRequest::Type expected_type = 1722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if defined(OS_CHROMEOS) 1732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) em::DeviceRegisterRequest::USER; 1742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#else 1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) em::DeviceRegisterRequest::BROWSER; 1762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif 1772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const bool expect_reregister = true; 1782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) interceptor_->PushJobCallback( 1792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); 1802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); 1822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) ASSERT_NO_FATAL_FAILURE(Register()); 1832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); 1842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 1852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} // namespace policy 187