MCPcopy Create free account
hub / github.com/apache/mesos / TEST_F

Function TEST_F

src/tests/zookeeper_tests.cpp:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45TEST_F(ZooKeeperTest, Auth)
46{
47 ZooKeeperTest::TestWatcher watcher;
48
49 ZooKeeper authenticatedZk(server->connectString(), NO_TIMEOUT, &watcher);
50 watcher.awaitSessionEvent(ZOO_CONNECTED_STATE);
51 authenticatedZk.authenticate("digest", "creator:creator");
52 authenticatedZk.create("/test",
53 "42",
54 zookeeper::EVERYONE_READ_CREATOR_ALL,
55 0,
56 nullptr);
57 ASSERT_ZK_GET("42", &authenticatedZk, "/test");
58
59 ZooKeeper unauthenticatedZk(server->connectString(), NO_TIMEOUT, &watcher);
60 watcher.awaitSessionEvent(ZOO_CONNECTED_STATE);
61 ASSERT_ZK_GET("42", &unauthenticatedZk, "/test");
62 ASSERT_EQ(ZNOAUTH, unauthenticatedZk.set("/test", "", -1));
63
64 ZooKeeper nonOwnerZk(server->connectString(), NO_TIMEOUT, &watcher);
65 watcher.awaitSessionEvent(ZOO_CONNECTED_STATE);
66 nonOwnerZk.authenticate("digest", "non-owner:non-owner");
67 ASSERT_ZK_GET("42", &nonOwnerZk, "/test");
68 ASSERT_EQ(ZNOAUTH, nonOwnerZk.set("/test", "", -1));
69}
70
71
72TEST_F(ZooKeeperTest, SessionTimeoutNegotiation)

Callers

nothing calls this directly

Calls 15

SecondsClass · 0.85
startsWithFunction · 0.85
NoneClass · 0.85
connectStringMethod · 0.80
awaitSessionEventMethod · 0.80
shutdownNetworkMethod · 0.80
withdrawMethod · 0.80
sessionMethod · 0.80
expireSessionMethod · 0.80
startNetworkMethod · 0.80
joinMethod · 0.65
authenticateMethod · 0.45

Tested by

no test coverage detected