BOOST_AUTO_TEST_SUITE(ClientUtils)
-BOOST_AUTO_TEST_CASE(ParseZoneIdFromCpuSetTest)
+BOOST_AUTO_TEST_CASE(ParseZoneIdFromCpuSet)
{
auto testBad = [](const std::string& input) {
std::string ret;
BOOST_FIXTURE_TEST_SUITE(ClientSuite, Fixture)
-BOOST_AUTO_TEST_CASE(NotRunningServerTest)
+BOOST_AUTO_TEST_CASE(NotRunningServer)
{
cm.shutdownAll();
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(GetZoneDbusesTest)
+BOOST_AUTO_TEST_CASE(GetZoneDbuses)
{
VsmClient client = vsm_client_create();
VsmStatus status = vsm_connect(client);
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(GetZoneIdsTest)
+BOOST_AUTO_TEST_CASE(GetZoneIds)
{
VsmClient client = vsm_client_create();
VsmStatus status = vsm_connect(client);
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(GetActiveZoneIdTest)
+BOOST_AUTO_TEST_CASE(GetActiveZoneId)
{
VsmClient client = vsm_client_create();
VsmStatus status = vsm_connect(client);
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(SetActiveZoneTest)
+BOOST_AUTO_TEST_CASE(SetActiveZone)
{
const std::string newActiveZoneId = "zone2";
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(CreateZoneTest)
+BOOST_AUTO_TEST_CASE(CreateZone)
{
const std::string newActiveZoneId = "";
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(StartShutdownZoneTest)
+BOOST_AUTO_TEST_CASE(StartShutdownZone)
{
const std::string newActiveZoneId = "zone1";
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(LockUnlockZoneTest)
+BOOST_AUTO_TEST_CASE(LockUnlockZone)
{
const std::string newActiveZoneId = "zone2";
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(FileMoveRequestTest)
+BOOST_AUTO_TEST_CASE(FileMoveRequest)
{
const std::string path = "/tmp/fake_path";
const std::string secondZone = "fake_zone";
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(NotificationTest)
+BOOST_AUTO_TEST_CASE(Notification)
{
const std::string MSG_CONTENT = "msg";
const std::string MSG_APP = "app";
}
}
-BOOST_AUTO_TEST_CASE(GetZoneIdByPidTest1)
+BOOST_AUTO_TEST_CASE(GetZoneIdByPidTestSingle)
{
VsmClient client = vsm_client_create();
VsmString zone;
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(GetZoneIdByPidTest2)
+BOOST_AUTO_TEST_CASE(GetZoneIdByPidTestMultiple)
{
std::set<std::string> ids;
}
}
-BOOST_AUTO_TEST_CASE(GrantRevokeTest)
+BOOST_AUTO_TEST_CASE(GrantRevoke)
{
const std::string zoneId = "zone2";
const std::string dev = "tty3";
vsm_client_free(client);
}
-BOOST_AUTO_TEST_CASE(ProvisionTest)
+BOOST_AUTO_TEST_CASE(Provision)
{
VsmClient client = vsm_client_create();
BOOST_REQUIRE_EQUAL(VSMCLIENT_SUCCESS, vsm_connect(client));
BOOST_FIXTURE_TEST_SUITE(ConfigurationSuite, Fixture)
-BOOST_AUTO_TEST_CASE(FromJsonStringTest)
+BOOST_AUTO_TEST_CASE(FromJsonString)
{
TestConfig testConfig;
}
-BOOST_AUTO_TEST_CASE(ToJsonStringTest)
+BOOST_AUTO_TEST_CASE(ToJsonString)
{
TestConfig testConfig;
BOOST_REQUIRE_NO_THROW(loadFromJsonString(jsonTestString, testConfig));
} // namespace loadErrorsTest
-BOOST_AUTO_TEST_CASE(JsonLoadErrorsTest)
+BOOST_AUTO_TEST_CASE(JsonLoadErrors)
{
using namespace loadErrorsTest;
} // namespace hasVisitableTest
-BOOST_AUTO_TEST_CASE(HasVisibleInternalHelperTest)
+BOOST_AUTO_TEST_CASE(HasVisibleInternalHelper)
{
using namespace hasVisitableTest;
BOOST_CHECK(isVisitable<Visitable>());
}
-BOOST_AUTO_TEST_CASE(FromToKVStoreTest)
+BOOST_AUTO_TEST_CASE(FromToKVStore)
{
TestConfig config;
loadFromJsonString(jsonTestString, config);
BOOST_CHECK_EQUAL(out, jsonTestString);
}
-BOOST_AUTO_TEST_CASE(FromToFDTest)
+BOOST_AUTO_TEST_CASE(FromToFD)
{
TestConfig config;
loadFromJsonString(jsonTestString, config);
BOOST_CHECK(::close(fd) >= 0);
}
-BOOST_AUTO_TEST_CASE(FromKVWithDefaultsTest)
+BOOST_AUTO_TEST_CASE(FromKVWithDefaults)
{
TestConfig config;
loadFromJsonString(jsonTestString, config);
BOOST_CHECK_EQUAL(out2, jsonTestString);
}
-BOOST_AUTO_TEST_CASE(PartialConfigTest)
+BOOST_AUTO_TEST_CASE(PartialConfig)
{
// check if partial config is fully supported
TestConfig config;
}
}
-BOOST_AUTO_TEST_CASE(ConfigUnionTest)
+BOOST_AUTO_TEST_CASE(ConfigUnion)
{
TestConfig testConfig;
BOOST_REQUIRE_NO_THROW(loadFromJsonString(jsonTestString, testConfig));
}
-BOOST_AUTO_TEST_CASE(GVariantVisitorTest)
+BOOST_AUTO_TEST_CASE(GVariantVisitor)
{
TestConfig testConfig;
BOOST_REQUIRE_NO_THROW(loadFromJsonString(jsonTestString, testConfig));
const std::string KEY = "KEY";
-BOOST_AUTO_TEST_CASE(SimpleConstructorDestructorTest)
+BOOST_AUTO_TEST_CASE(SimpleConstructorDestructor)
{
std::unique_ptr<KVStore> conPtr;
BOOST_REQUIRE_NO_THROW(conPtr.reset(new KVStore(dbPath)));
BOOST_CHECK(fs::exists(dbPath));
}
-BOOST_AUTO_TEST_CASE(EscapedCharactersTest)
+BOOST_AUTO_TEST_CASE(EscapedCharacters)
{
// '*' ?' '[' ']' are escaped
// They shouldn't influence the internal implementation
} // namespace
-BOOST_AUTO_TEST_CASE(SingleValueTest)
+BOOST_AUTO_TEST_CASE(SingleValue)
{
testSingleValue<std::string, std::string>(*this, "A", "B");
testSingleValue<int, int>(*this, 1, 2);
}
} // namespace
-BOOST_AUTO_TEST_CASE(VectorOfValuesTest)
+BOOST_AUTO_TEST_CASE(VectorOfValues)
{
testVectorOfValues<std::string>(*this, {"A", "B"}, {"A", "C"}, {"A", "B", "C"});
testVectorOfValues<int>(*this, {1, 2}, {1, 3}, {1, 2, 3});
testVectorOfValues<TestClass>(*this, {1, 2}, {1, 3}, {1, 2, 3});
}
-BOOST_AUTO_TEST_CASE(ClearTest)
+BOOST_AUTO_TEST_CASE(Clear)
{
BOOST_CHECK_NO_THROW(c.clear());
std::vector<std::string> vec = {"A", "B"};
BOOST_CHECK_THROW(c.get(KEY), ConfigException);
}
-BOOST_AUTO_TEST_CASE(TransactionTest)
+BOOST_AUTO_TEST_CASE(Transaction)
{
{
KVStore::Transaction trans(c);
}
}
-BOOST_AUTO_TEST_CASE(TransactionStackedTest)
+BOOST_AUTO_TEST_CASE(TransactionStacked)
{
{
KVStore::Transaction transOuter(c);
}
}
-BOOST_AUTO_TEST_CASE(TransactionThreadsTest)
+BOOST_AUTO_TEST_CASE(TransactionThreads)
{
Latch trans1Started, trans1Release, trans2Released;
std::thread thread1([&] {
thread2.join();
}
-BOOST_AUTO_TEST_CASE(KeyTest)
+BOOST_AUTO_TEST_CASE(Key)
{
BOOST_CHECK_EQUAL(key(), "");
BOOST_CHECK_EQUAL(key<>(), "");
} // namespace
-BOOST_AUTO_TEST_CASE(DbusDaemonTest)
+BOOST_AUTO_TEST_CASE(DbusDaemon)
{
ScopedDbusDaemon daemon;
}
-BOOST_AUTO_TEST_CASE(NoDbusTest)
+BOOST_AUTO_TEST_CASE(NoDbus)
{
ScopedGlibLoop loop;
BOOST_CHECK_THROW(DbusConnection::create(DBUS_ADDRESS), DbusIOException);
}
-BOOST_AUTO_TEST_CASE(ConnectionTest)
+BOOST_AUTO_TEST_CASE(Connection)
{
ScopedGlibLoop loop;
DbusConnection::Pointer connSystem = DbusConnection::createSystem();
}
-BOOST_AUTO_TEST_CASE(SimpleTest)
+BOOST_AUTO_TEST_CASE(Simple)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK(nameLost.empty());
}
-BOOST_AUTO_TEST_CASE(ConnectionLostTest)
+BOOST_AUTO_TEST_CASE(ConnectionLost)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK(nameLost.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(NameOwnerTest)
+BOOST_AUTO_TEST_CASE(NameOwner)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
//BOOST_CHECK(nameAcquired2.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(GenericSignalTest)
+BOOST_AUTO_TEST_CASE(GenericSignal)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK(signalEmitted.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(FilteredSignalTest)
+BOOST_AUTO_TEST_CASE(FilteredSignal)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK(wrongSignalEmitted.empty());
}
-BOOST_AUTO_TEST_CASE(RegisterObjectTest)
+BOOST_AUTO_TEST_CASE(RegisterObject)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK_NO_THROW(conn->registerObject(TESTAPI_OBJECT_PATH, TESTAPI_DEFINITION, callback));
}
-BOOST_AUTO_TEST_CASE(IntrospectSystemTest)
+BOOST_AUTO_TEST_CASE(IntrospectSystem)
{
ScopedGlibLoop loop;
DbusConnection::Pointer conn = DbusConnection::createSystem();
BOOST_CHECK(!iface.empty());
}
-BOOST_AUTO_TEST_CASE(IntrospectTest)
+BOOST_AUTO_TEST_CASE(Introspect)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK(std::string::npos != iface.find(TESTAPI_SIGNAL_NOTIFY));
}
-BOOST_AUTO_TEST_CASE(MethodCallTest)
+BOOST_AUTO_TEST_CASE(MethodCall)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
DbusCustomException);
}
-BOOST_AUTO_TEST_CASE(MethodAsyncCallTest)
+BOOST_AUTO_TEST_CASE(MethodAsyncCall)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_REQUIRE(callDone.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(MethodAsyncCallAsyncHandlerTest)
+BOOST_AUTO_TEST_CASE(MethodAsyncCallAsyncHandler)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_REQUIRE(callDone.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(MethodCallExceptionTest)
+BOOST_AUTO_TEST_CASE(MethodCallException)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
DbusOperationException);
}
-BOOST_AUTO_TEST_CASE(DbusApiTest)
+BOOST_AUTO_TEST_CASE(DbusApi)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
WhatEquals("Argument: 666"));
}
-BOOST_AUTO_TEST_CASE(DbusApiNotifyTest)
+BOOST_AUTO_TEST_CASE(DbusApiNotify)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK(notified.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(DbusApiNameAcquiredTest)
+BOOST_AUTO_TEST_CASE(DbusApiNameAcquired)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK_NO_THROW(client.noop());
}
-BOOST_AUTO_TEST_CASE(DbusApiConnectionLost1Test)
+BOOST_AUTO_TEST_CASE(DbusApiConnectionLost)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK_THROW(client.noop(), DbusIOException);
}
-BOOST_AUTO_TEST_CASE(DbusApiConnectionLost2Test)
+BOOST_AUTO_TEST_CASE(DbusApiConnectionLostDelayedCallbackSet)
{
ScopedDbusDaemon daemon;
ScopedGlibLoop loop;
BOOST_CHECK(l.wait(TIMEOUT));
}
-// MULTI_FIXTURE_TEST_CASE(ConnectionLimitTest, F, ThreadedFixture, GlibFixture)
+// MULTI_FIXTURE_TEST_CASE(ConnectionLimit, F, ThreadedFixture, GlibFixture)
// {
// unsigned oldLimit = ipc::getMaxFDNumber();
// ipc::setMaxFDNumber(50);
} // namespace
-BOOST_AUTO_TEST_CASE(LogLevelSetandGet)
+BOOST_AUTO_TEST_CASE(LogLevelSetAndGet)
{
Logger::setLogLevel(LogLevel::TRACE);
BOOST_CHECK(LogLevel::TRACE == Logger::getLogLevel());
BOOST_CHECK(LogLevel::ERROR == Logger::getLogLevel());
}
-BOOST_AUTO_TEST_CASE(StringLogLevelSetandGet)
+BOOST_AUTO_TEST_CASE(StringLogLevelSetAndGet)
{
Logger::setLogLevel("TRACE");
BOOST_CHECK(LogLevel::TRACE == Logger::getLogLevel());
WhatEquals("Invalid LogLevel to parse")); //TODO change message
}
-BOOST_AUTO_TEST_CASE(TestLogsError)
+BOOST_AUTO_TEST_CASE(LogsLevelError)
{
TestLog tf(LogLevel::ERROR);
exampleTestLogs();
BOOST_CHECK(tf.logContains("[TRACE]") == false);
}
-BOOST_AUTO_TEST_CASE(TestLogsWarn)
+BOOST_AUTO_TEST_CASE(LogsLevelWarn)
{
TestLog tf(LogLevel::WARN);
exampleTestLogs();
BOOST_CHECK(tf.logContains("[TRACE]") == false);
}
-BOOST_AUTO_TEST_CASE(TestLogsInfo)
+BOOST_AUTO_TEST_CASE(LogsLevelInfo)
{
TestLog tf(LogLevel::INFO);
exampleTestLogs();
BOOST_CHECK(tf.logContains("[TRACE]") == false);
}
-BOOST_AUTO_TEST_CASE(TestLogsDebug)
+BOOST_AUTO_TEST_CASE(LogsLevelDebug)
{
TestLog tf(LogLevel::DEBUG);
exampleTestLogs();
BOOST_CHECK(tf.logContains("[TRACE]") == false);
}
-BOOST_AUTO_TEST_CASE(TestLogsTrace)
+BOOST_AUTO_TEST_CASE(LogsLevelTrace)
{
TestLog tf(LogLevel::TRACE);
exampleTestLogs();
BOOST_CHECK(tf.logContains("[TRACE]") == true);
}
-BOOST_AUTO_TEST_CASE(TestLoggerScope)
+BOOST_AUTO_TEST_CASE(LoggerScope)
{
LOGS("Main function scope");
BOOST_FIXTURE_TEST_SUITE(LxcZoneSuite, Fixture)
-BOOST_AUTO_TEST_CASE(ConstructorDestructorTest)
+BOOST_AUTO_TEST_CASE(ConstructorDestructor)
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
}
-BOOST_AUTO_TEST_CASE(CreateDestroyTest)
+BOOST_AUTO_TEST_CASE(CreateDestroy)
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
BOOST_CHECK(!lxc.isDefined());
BOOST_CHECK(!lxc.isDefined());
}
-BOOST_AUTO_TEST_CASE(StartShutdownTest)
+BOOST_AUTO_TEST_CASE(StartShutdown)
{
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
BOOST_CHECK(lxc.destroy());
}
-BOOST_AUTO_TEST_CASE(StartStopTest)
+BOOST_AUTO_TEST_CASE(StartStop)
{
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
BOOST_CHECK(lxc.destroy());
}
-BOOST_AUTO_TEST_CASE(StartHasStoppedTest)
+BOOST_AUTO_TEST_CASE(StartHasStopped)
{
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
BOOST_CHECK(lxc.destroy());
}
-BOOST_AUTO_TEST_CASE(FreezeUnfreezeTest)
+BOOST_AUTO_TEST_CASE(FreezeUnfreeze)
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
BOOST_CHECK(lxc.create(TEMPLATE, TEMPLATE_ARGS));
BOOST_CHECK(lxc.destroy());
}
-BOOST_AUTO_TEST_CASE(FreezeStopTest)
+BOOST_AUTO_TEST_CASE(FreezeStop)
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
BOOST_CHECK(lxc.create(TEMPLATE, TEMPLATE_ARGS));
BOOST_CHECK(lxc.destroy());
}
-BOOST_AUTO_TEST_CASE(RepeatTest)
+BOOST_AUTO_TEST_CASE(Repeat)
{
LxcZone lxc(LXC_PATH, ZONE_NAME);
BOOST_CHECK(lxc.create(TEMPLATE, TEMPLATE_ARGS));
BOOST_FIXTURE_TEST_SUITE(InputMonitorSuite, Fixture)
-BOOST_AUTO_TEST_CASE(Config_OK)
+BOOST_AUTO_TEST_CASE(ConfigOK)
{
InputMonitor inputMonitor(inputConfig, InputMonitor::NotifyCallback());
}
-BOOST_AUTO_TEST_CASE(Config_timeWindowMsTooHigh)
+BOOST_AUTO_TEST_CASE(ConfigTimeWindowMsTooHigh)
{
inputConfig.timeWindowMs = 50000;
WhatEquals("Time window exceeds maximum"));
}
-BOOST_AUTO_TEST_CASE(Config_deviceFilePathNotExisting)
+BOOST_AUTO_TEST_CASE(ConfigDeviceFilePathNotExisting)
{
inputConfig.device = TEST_INPUT_DEVICE + "notExisting";
} // namespace
-BOOST_AUTO_TEST_CASE(Event_oneAtATime)
+BOOST_AUTO_TEST_CASE(EventOneAtATime)
{
sendNEvents(*this, 1);
}
-BOOST_AUTO_TEST_CASE(Event_tenAtATime)
+BOOST_AUTO_TEST_CASE(EventTenAtATime)
{
sendNEvents(*this, 10);
}
} // namespace
-BOOST_AUTO_TEST_CASE(Event_oneAtATimeWithPauses)
+BOOST_AUTO_TEST_CASE(EventOneAtATimeWithPauses)
{
sendNEventsWithPauses(*this, 1);
}
-BOOST_AUTO_TEST_CASE(Event_tenAtATimeWithPauses)
+BOOST_AUTO_TEST_CASE(EventTenAtATimeWithPauses)
{
sendNEventsWithPauses(*this, 10);
}
using namespace vasum;
using namespace config;
-BOOST_AUTO_TEST_CASE(ConstructorDestructorTest)
+BOOST_AUTO_TEST_CASE(ConstructorDestructor)
{
std::unique_ptr<Server> s;
s.reset(new Server(TEST_CONFIG_PATH));
s.reset();
}
-BOOST_AUTO_TEST_CASE(MissingConfigTest)
+BOOST_AUTO_TEST_CASE(MissingConfig)
{
BOOST_REQUIRE_EXCEPTION(Server(MISSING_CONFIG_PATH).run(AS_ROOT),
ConfigException,
WhatEquals("Could not load " + MISSING_CONFIG_PATH));
}
-BOOST_AUTO_TEST_CASE(TerminateTest)
+BOOST_AUTO_TEST_CASE(Terminate)
{
Server s(TEST_CONFIG_PATH);
s.terminate();
}
-BOOST_AUTO_TEST_CASE(TerminateRunTest)
+BOOST_AUTO_TEST_CASE(TerminateRun)
{
Server s(TEST_CONFIG_PATH);
s.terminate();
s.run(AS_ROOT);
}
-BOOST_AUTO_TEST_CASE(RunTerminateTest)
+BOOST_AUTO_TEST_CASE(RunTerminate)
{
Server s(TEST_CONFIG_PATH);
std::future<void> runFuture = std::async(std::launch::async, [&] {s.run(AS_ROOT);});
BOOST_FIXTURE_TEST_SUITE(ZoneAdminSuite, Fixture)
-BOOST_AUTO_TEST_CASE(ConstructorDestructorTest)
+BOOST_AUTO_TEST_CASE(ConstructorDestructor)
{
auto admin = create(TEST_CONFIG_PATH);
admin.reset();
}
-BOOST_AUTO_TEST_CASE(MissingConfigTest)
+BOOST_AUTO_TEST_CASE(MissingConfig)
{
BOOST_REQUIRE_EXCEPTION(create(MISSING_CONFIG_PATH),
ZoneOperationException,
WhatEquals("Could not create zone"));
}
-BOOST_AUTO_TEST_CASE(StartTest)
+BOOST_AUTO_TEST_CASE(Start)
{
auto admin = create(TEST_CONFIG_PATH);
BOOST_CHECK(admin->isRunning());
}
-BOOST_AUTO_TEST_CASE(StartBuggyTest)
+BOOST_AUTO_TEST_CASE(StartBuggy)
{
auto admin = create(BUGGY_CONFIG_PATH);
BOOST_REQUIRE_EXCEPTION(admin->start(),
WhatEquals("Could not start zone"));
}
-BOOST_AUTO_TEST_CASE(StopShutdownTest)
+BOOST_AUTO_TEST_CASE(StopShutdown)
{
auto admin = create(TEST_CONFIG_PATH);
}
// This test needs to wait for a shutdown timer in stop() method. This takes 10s+.
-BOOST_AUTO_TEST_CASE(StopDestroyTest)
+BOOST_AUTO_TEST_CASE(StopDestroy)
{
auto admin = create(TEST_NO_SHUTDOWN_CONFIG_PATH);
BOOST_CHECK(admin->isStopped());
}
-BOOST_AUTO_TEST_CASE(SuspendResumeTest)
+BOOST_AUTO_TEST_CASE(SuspendResume)
{
auto admin = create(TEST_NO_SHUTDOWN_CONFIG_PATH);
BOOST_CHECK(admin->isRunning());
}
-BOOST_AUTO_TEST_CASE(SchedulerLevelTest)
+BOOST_AUTO_TEST_CASE(ForegroundBackgroundSchedulerLevel)
{
auto admin = create(TEST_CONFIG_PATH);
BOOST_FIXTURE_TEST_SUITE(ZoneConnectionSuite, Fixture)
-BOOST_AUTO_TEST_CASE(ConstructorDestructorConnectTest)
+BOOST_AUTO_TEST_CASE(ConstructorDestructorConnect)
{
ZoneConnection(acquireAddress(), nullptr);
}
-BOOST_AUTO_TEST_CASE(NotifyActiveZoneApiTest)
+BOOST_AUTO_TEST_CASE(NotifyActiveZoneApi)
{
Latch notifyCalled;
ZoneConnection connection(acquireAddress(), nullptr);
BOOST_CHECK(notifyCalled.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(SignalNotificationApiTest)
+BOOST_AUTO_TEST_CASE(SignalNotificationApi)
{
Latch signalEmitted;
ZoneConnection connection(acquireAddress(), nullptr);
BOOST_CHECK(signalEmitted.wait(EVENT_TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(SignalDisplayOffApiTest)
+BOOST_AUTO_TEST_CASE(SignalDisplayOffApi)
{
Latch displayOffCalled;
ZoneConnection connection(acquireAddress(), nullptr);
BOOST_FIXTURE_TEST_SUITE(ZoneProvisionSuite, Fixture)
-BOOST_AUTO_TEST_CASE(DestructorTest)
+BOOST_AUTO_TEST_CASE(Destructor)
{
const fs::path mountTarget = fs::path("/opt/usr/data/ut-from-host-provision");
const fs::path mountSource = fs::path("/tmp/ut-provision");
BOOST_CHECK(!fs::exists(mountSource));
}
-BOOST_AUTO_TEST_CASE(FileTest)
+BOOST_AUTO_TEST_CASE(File)
{
//TODO: Test Fifo
const fs::path regularFile = fs::path("/opt/usr/data/ut-regular-file");
zoneProvision.stop();
}
-BOOST_AUTO_TEST_CASE(MountTest)
+BOOST_AUTO_TEST_CASE(Mount)
{
//TODO: Test Fifo
const fs::path mountTarget = fs::path("/opt/usr/data/ut-from-host-provision");
zoneProvision.stop();
}
-BOOST_AUTO_TEST_CASE(LinkTest)
+BOOST_AUTO_TEST_CASE(Link)
{
const fs::path linkFile = fs::path("/ut-from-host-file.txt");
}
}
-BOOST_AUTO_TEST_CASE(DeclareFileTest)
+BOOST_AUTO_TEST_CASE(DeclareFile)
{
ZoneProvision zoneProvision = create({});
zoneProvision.declareFile(1, "path", 0747, 0777);
BOOST_CHECK_EQUAL(provision.mode, 0777);
}
-BOOST_AUTO_TEST_CASE(DeclareMountTest)
+BOOST_AUTO_TEST_CASE(DeclareMount)
{
ZoneProvision zoneProvision = create({});
zoneProvision.declareMount("/fake/path1", "/fake/path2", "tmpfs", 077, "fake");
BOOST_CHECK_EQUAL(provision.data, "fake");
}
-BOOST_AUTO_TEST_CASE(DeclareLinkTest)
+BOOST_AUTO_TEST_CASE(DeclareLink)
{
ZoneProvision zoneProvision = create({});
zoneProvision.declareLink("/fake/path1", "/fake/path2");
BOOST_CHECK_EQUAL(provision.target, "/fake/path2");
}
-BOOST_AUTO_TEST_CASE(ProvisionedAlreadyTest)
+BOOST_AUTO_TEST_CASE(ProvisionedAlready)
{
const fs::path dir = fs::path("/opt/usr/data/ut-from-host");
const fs::path linkFile = fs::path("/ut-from-host-file.txt");
zoneProvision.stop();
}
-BOOST_AUTO_TEST_CASE(ListTest)
+BOOST_AUTO_TEST_CASE(List)
{
std::vector<std::string> expected;
ZoneProvision zoneProvision = create({});
}
}
-BOOST_AUTO_TEST_CASE(RemoveTest)
+BOOST_AUTO_TEST_CASE(Remove)
{
std::vector<std::string> expected;
ZoneProvision zoneProvision = create({});
BOOST_FIXTURE_TEST_SUITE(ZoneSuite, Fixture)
-BOOST_AUTO_TEST_CASE(ConstructorDestructorTest)
+BOOST_AUTO_TEST_CASE(ConstructorDestructor)
{
auto c = create(TEST_CONFIG_PATH);
c.reset();
}
-BOOST_AUTO_TEST_CASE(BuggyConfigTest)
+BOOST_AUTO_TEST_CASE(BuggyConfig)
{
BOOST_REQUIRE_EXCEPTION(create(BUGGY_CONFIG_PATH),
ZoneOperationException,
WhatEquals("Could not create zone"));
}
-BOOST_AUTO_TEST_CASE(MissingConfigTest)
+BOOST_AUTO_TEST_CASE(MissingConfig)
{
BOOST_REQUIRE_EXCEPTION(create(MISSING_CONFIG_PATH),
ConfigException,
WhatEquals("Could not load " + MISSING_CONFIG_PATH));
}
-BOOST_AUTO_TEST_CASE(StartStopTest)
+BOOST_AUTO_TEST_CASE(StartStop)
{
auto c = create(TEST_CONFIG_PATH);
c->start();
c->stop(true);
}
-BOOST_AUTO_TEST_CASE(DbusConnectionTest)
+BOOST_AUTO_TEST_CASE(DbusConnection)
{
mRunGuard.create("/tmp/ut-run"); // the same path as in lxc template
// TODO: DbusReconnectionTest
-BOOST_AUTO_TEST_CASE(ListNetdevTest)
+BOOST_AUTO_TEST_CASE(ListNetdev)
{
typedef std::vector<std::string> NetdevList;
BOOST_CHECK(hostNetdevs != netdevs);
}
-BOOST_AUTO_TEST_CASE(CreateNetdevVethTest)
+BOOST_AUTO_TEST_CASE(CreateNetdevVeth)
{
typedef std::vector<std::string> NetdevList;
hostNetdevsThrow.begin(), hostNetdevsThrow.end());
}
-BOOST_AUTO_TEST_CASE(CreateNetdevMacvlanTest)
+BOOST_AUTO_TEST_CASE(CreateNetdevMacvlan)
{
typedef std::vector<std::string> NetdevList;
BOOST_FIXTURE_TEST_SUITE(ZonesManagerSuite, Fixture)
-BOOST_AUTO_TEST_CASE(ConstructorDestructorTest)
+BOOST_AUTO_TEST_CASE(ConstructorDestructor)
{
std::unique_ptr<ZonesManager> cm;
cm.reset(new ZonesManager(TEST_CONFIG_PATH));
cm.reset();
}
-BOOST_AUTO_TEST_CASE(MissingConfigTest)
+BOOST_AUTO_TEST_CASE(MissingConfig)
{
BOOST_REQUIRE_EXCEPTION(ZonesManager{MISSING_CONFIG_PATH},
ConfigException,
WhatEquals("Could not load " + MISSING_CONFIG_PATH));
}
-BOOST_AUTO_TEST_CASE(CreateTest)
+BOOST_AUTO_TEST_CASE(Create)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
cm.createZone("zone2", SIMPLE_TEMPLATE);
}
-BOOST_AUTO_TEST_CASE(StartStopTest)
+BOOST_AUTO_TEST_CASE(StartStop)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), "");
}
-BOOST_AUTO_TEST_CASE(DetachOnExitTest)
+BOOST_AUTO_TEST_CASE(DetachOnExit)
{
{
ZonesManager cm(TEST_CONFIG_PATH);
}
}
-BOOST_AUTO_TEST_CASE(FocusTest)
+BOOST_AUTO_TEST_CASE(Focus)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
BOOST_CHECK(cm.getRunningForegroundZoneId() == "zone3");
}
-BOOST_AUTO_TEST_CASE(NotifyActiveZoneTest)
+BOOST_AUTO_TEST_CASE(NotifyActiveZone)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", DBUS_TEMPLATE);
dbuses.clear();
}
-BOOST_AUTO_TEST_CASE(DisplayOffTest)
+BOOST_AUTO_TEST_CASE(DisplayOff)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", DBUS_TEMPLATE);
}
}
-BOOST_AUTO_TEST_CASE(MoveFileTest)
+BOOST_AUTO_TEST_CASE(MoveFile)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", DBUS_TEMPLATE);
fs::remove_all(ZONE2PATH, ec);
}
-BOOST_AUTO_TEST_CASE(AllowSwitchToDefaultTest)
+BOOST_AUTO_TEST_CASE(AllowSwitchToDefault)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", DBUS_TEMPLATE);
}
}
-BOOST_AUTO_TEST_CASE(ProxyCallTest)
+BOOST_AUTO_TEST_CASE(ProxyCall)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", DBUS_TEMPLATE);
"unix:path=/tmp/ut-run/zone3/dbus/system_bus_socket"}};
} // namespace
-BOOST_AUTO_TEST_CASE(GetZoneDbusesTest)
+BOOST_AUTO_TEST_CASE(GetZoneDbuses)
{
DbusAccessory host(DbusAccessory::HOST_ID);
ZonesManager cm(TEST_CONFIG_PATH);
BOOST_CHECK(EXPECTED_DBUSES_NONE == host.callMethodGetZoneDbuses());
}
-BOOST_AUTO_TEST_CASE(GetZoneDbusesNoDbusTest)
+BOOST_AUTO_TEST_CASE(GetZoneDbusesNoDbus)
{
DbusAccessory host(DbusAccessory::HOST_ID);
ZonesManager cm(TEST_CONFIG_PATH);
BOOST_CHECK(EXPECTED_DBUSES_NONE == host.callMethodGetZoneDbuses());
}
-BOOST_AUTO_TEST_CASE(ZoneDbusesSignalsTest)
+BOOST_AUTO_TEST_CASE(ZoneDbusesSignals)
{
Latch signalLatch;
DbusAccessory::Dbuses collectedDbuses;
}
-BOOST_AUTO_TEST_CASE(GetZoneIdsTest)
+BOOST_AUTO_TEST_CASE(GetZoneIds)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
BOOST_CHECK(returnedIds == zoneIds);// order should be preserved
}
-BOOST_AUTO_TEST_CASE(GetActiveZoneIdTest)
+BOOST_AUTO_TEST_CASE(GetActiveZoneId)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
BOOST_CHECK(dbus.callMethodGetActiveZoneId() == "");
}
-BOOST_AUTO_TEST_CASE(SetActiveZoneTest)
+BOOST_AUTO_TEST_CASE(SetActiveZone)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", SIMPLE_TEMPLATE);
WhatEquals("Could not activate stopped or paused zone"));
}
-BOOST_AUTO_TEST_CASE(CreateDestroyZoneTest)
+BOOST_AUTO_TEST_CASE(CreateDestroyZone)
{
const std::string zone1 = "test1";
const std::string zone2 = "test2";
BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), "");
}
-BOOST_AUTO_TEST_CASE(CreateDestroyZonePersistenceTest)
+BOOST_AUTO_TEST_CASE(CreateDestroyZonePersistence)
{
const std::string zone = "test1";
BOOST_CHECK(getZoneIds().empty());
}
-BOOST_AUTO_TEST_CASE(ZoneStatePersistenceTest)
+BOOST_AUTO_TEST_CASE(ZoneStatePersistence)
{
const std::string zone1 = "zone1";
const std::string zone2 = "zone2";
}
}
-BOOST_AUTO_TEST_CASE(StartShutdownZoneTest)
+BOOST_AUTO_TEST_CASE(StartShutdownZone)
{
const std::string zone1 = "zone1";
const std::string zone2 = "zone2";
BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), "");
}
-BOOST_AUTO_TEST_CASE(LockUnlockZoneTest)
+BOOST_AUTO_TEST_CASE(LockUnlockZone)
{
ZonesManager cm(TEST_CONFIG_PATH);
cm.createZone("zone1", DBUS_TEMPLATE);
const int unsigned TIMEOUT = 1000;
-BOOST_AUTO_TEST_CASE(EmptyTest)
+BOOST_AUTO_TEST_CASE(Empty)
{
CallbackGuard guard;
BOOST_CHECK_EQUAL(0, guard.getTrackersCount());
BOOST_CHECK(guard.waitForTrackers(TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(SimpleTest)
+BOOST_AUTO_TEST_CASE(Simple)
{
CallbackGuard guard;
guard.spawn();
BOOST_CHECK(guard.waitForTrackers(TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(ThreadTest)
+BOOST_AUTO_TEST_CASE(Thread)
{
Latch trackerCreated;
Latch trackerCanBeDestroyed;
using namespace vasum::utils;
-BOOST_AUTO_TEST_CASE(CountingTest)
+BOOST_AUTO_TEST_CASE(Counting)
{
CountingMap<std::string> map;
BOOST_FIXTURE_TEST_SUITE(UtilsFSSuite, Fixture)
-BOOST_AUTO_TEST_CASE(ReadFileContentTest)
+BOOST_AUTO_TEST_CASE(ReadFileContent)
{
BOOST_CHECK_EQUAL(REFERENCE_FILE_CONTENT, readFileContent(REFERENCE_FILE_PATH));
BOOST_CHECK_EXCEPTION(readFileContent(BUGGY_FILE_PATH),
WhatEquals("Read failed"));
}
-BOOST_AUTO_TEST_CASE(SaveFileContentTest)
+BOOST_AUTO_TEST_CASE(SaveFileContent)
{
BOOST_REQUIRE(saveFileContent(FILE_PATH, REFERENCE_FILE_CONTENT));
BOOST_CHECK_EQUAL(REFERENCE_FILE_CONTENT, readFileContent(FILE_PATH));
}
-BOOST_AUTO_TEST_CASE(RemoveFileTest)
+BOOST_AUTO_TEST_CASE(RemoveFile)
{
BOOST_REQUIRE(saveFileContent(FILE_PATH, REFERENCE_FILE_CONTENT));
BOOST_REQUIRE(removeFile(FILE_PATH));
BOOST_REQUIRE(!boost::filesystem::exists(FILE_PATH));
}
-BOOST_AUTO_TEST_CASE(MountPointTest)
+BOOST_AUTO_TEST_CASE(MountPoint)
{
bool result;
namespace fs = boost::filesystem;
BOOST_REQUIRE(fs::remove(MOUNT_POINT_1, ec));
}
-BOOST_AUTO_TEST_CASE(MoveFileTest)
+BOOST_AUTO_TEST_CASE(MoveFile)
{
namespace fs = boost::filesystem;
boost::system::error_code ec;
BOOST_REQUIRE(fs::remove(MOUNT_POINT_2, ec));
}
-BOOST_AUTO_TEST_CASE(CopyDirContentsTest)
+BOOST_AUTO_TEST_CASE(CopyDirContents)
{
namespace fs = boost::filesystem;
std::string src, src_inner, src_inner2, dst, dst_inner, dst_inner2;
ScopedGlibLoop loop;
}
-BOOST_AUTO_TEST_CASE(GlibTimerEventTest)
+BOOST_AUTO_TEST_CASE(GlibTimerEvent)
{
ScopedGlibLoop loop;
std::atomic_uint counter(0);
using namespace vasum::utils;
-BOOST_AUTO_TEST_CASE(CreateFilePathTest)
+BOOST_AUTO_TEST_CASE(CreateFilePath)
{
BOOST_CHECK_EQUAL("", createFilePath());
BOOST_CHECK_EQUAL("a/b/.txt", createFilePath("a", "/b/", "/.txt"));
}
-BOOST_AUTO_TEST_CASE(DirNameTest)
+BOOST_AUTO_TEST_CASE(DirName)
{
BOOST_CHECK_EQUAL(".", dirName(""));
BOOST_CHECK_EQUAL(".", dirName("."));
using namespace vasum::utils;
-BOOST_AUTO_TEST_CASE(SimpleTest)
+BOOST_AUTO_TEST_CASE(Simple)
{
SameThreadGuard guard;
BOOST_CHECK(guard.check());
BOOST_CHECK(guard.check());
}
-BOOST_AUTO_TEST_CASE(ThreadTest)
+BOOST_AUTO_TEST_CASE(Thread)
{
SameThreadGuard guard;
};
} // namespace
-BOOST_AUTO_TEST_CASE(SimpleTypeTest)
+BOOST_AUTO_TEST_CASE(SimpleValue)
{
ValueLatch<int> testLatch;
BOOST_REQUIRE_EQUAL(testLatch.get(TIMEOUT), 3);
}
-BOOST_AUTO_TEST_CASE(ComplexTypeTest)
+BOOST_AUTO_TEST_CASE(ComplexValue)
{
ValueLatch<ComplexType> testLatch;
BOOST_REQUIRE_EQUAL(test.str, TEST_STRING);
}
-BOOST_AUTO_TEST_CASE(ComplexMovableTypeTest)
+BOOST_AUTO_TEST_CASE(ComplexMovableValue)
{
ValueLatch<ComplexMovableType> testLatch;
BOOST_REQUIRE_EQUAL(test.value.str, TEST_STRING);
}
-BOOST_AUTO_TEST_CASE(TimeoutTest)
+BOOST_AUTO_TEST_CASE(Timeout)
{
ValueLatch<int> testLatch;
WhatEquals("Timeout occured"));
}
-BOOST_AUTO_TEST_CASE(MultipleSetTest)
+BOOST_AUTO_TEST_CASE(MultipleSet)
{
ValueLatch<int> testLatch;
WhatEquals("Cannot set value multiple times"));
}
-BOOST_AUTO_TEST_CASE(MultipleGetTest)
+BOOST_AUTO_TEST_CASE(MultipleGet)
{
ValueLatch<int> testLatch;
const int unsigned TIMEOUT = 1000;
-BOOST_AUTO_TEST_CASE(NoTasksTest)
+BOOST_AUTO_TEST_CASE(NoTasks)
{
Worker::Pointer worker = Worker::create();
}
-BOOST_AUTO_TEST_CASE(NoTasks2Test)
+BOOST_AUTO_TEST_CASE(NoTasksWithSubWorkers)
{
Worker::Pointer worker = Worker::create();
Worker::Pointer sub1 = worker->createSubWorker();
worker.reset();
}
-BOOST_AUTO_TEST_CASE(SimpleTest)
+BOOST_AUTO_TEST_CASE(Simple)
{
Latch done;
BOOST_CHECK(done.wait(TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(QueueTest)
+BOOST_AUTO_TEST_CASE(Queue)
{
std::mutex mutex;
std::string result;
BOOST_CHECK_EQUAL("0123456789", result);
}
-BOOST_AUTO_TEST_CASE(ThreadResumeTest)
+BOOST_AUTO_TEST_CASE(ThreadResume)
{
Latch done;
BOOST_CHECK(done.wait(TIMEOUT));
}
-BOOST_AUTO_TEST_CASE(SubWorkerTest)
+BOOST_AUTO_TEST_CASE(SubWorker)
{
std::mutex mutex;
std::string result;
}
}
-BOOST_AUTO_TEST_CASE(NoCopyTest)
+BOOST_AUTO_TEST_CASE(NoCopy)
{
typedef std::atomic_int Counter;