Skip to content

Commit

Permalink
Outsources Connection Test + added Test for Connection to Socket with…
Browse files Browse the repository at this point in the history
…out Authentication
  • Loading branch information
FabiTheGuy committed Sep 19, 2024
1 parent f228c9f commit fcd878e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
8 changes: 1 addition & 7 deletions test/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#include <docker.hpp>
#include "test_connection.hpp"
#include <gtest/gtest.h>

TEST(DockerConnection, PingDaemon) {
dockerxx::Docker docker;

ASSERT_EQ(docker.ping(), "OK");
}

int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);

Expand Down
20 changes: 20 additions & 0 deletions test/test_connection.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef DOCKERXX_TEST_CONNECTION_HPP
#define DOCKERXX_TEST_CONNECTION_HPP

#include <gtest/gtest.h>
#include <docker.hpp>
#include "credential.hpp"

TEST(Connection, LocalDaemonPing) {
dockerxx::Docker docker;

ASSERT_EQ(docker.ping(), "OK");
}

TEST(Connection, RemoteDaemonPingNoAuthentication) {
dockerxx::Docker docker = dockerxx::Docker(REMOTE_DAEMON_ADDRESS);

ASSERT_EQ(docker.ping(), "OK");
}

#endif /* DOCKERXX_TEST_CONNECTION_HPP */

0 comments on commit fcd878e

Please sign in to comment.