ADD: added a podcontroller and test for the first basic usage

This commit is contained in:
Henry Winkel
2023-08-08 15:09:18 +02:00
parent 1c4c883648
commit 5f043ca88e
13 changed files with 196 additions and 192 deletions

View File

@@ -20,13 +20,13 @@ SCENARIO("Testing the SimCore Sensor")
// std::string uuid = "random" + std::to_string(random);
kubecontrol::KubePod pod1("debug-debian",uuid,"debugdebianhenry:0.1.2");
kubecontrol::KubePod pod1("debug-debian",uuid,"debugdebianhenry:0.1.3");
pod1.setEnvironmentVar("OWN_SHIP_SERVER", "127.0.0.1");
LOG_S(INFO)<<pod1.createYAML();
pod1.start(api,token);
LOG_S(INFO)<< pod1.getInfo(api, token).dump();
pod1.stop(api,token);
LOG_S(INFO)<<pod1.start(api,token);
LOG_S(INFO)<< pod1.getInfo(api, token);
// pod1.stop(api,token);
WHEN("constructing Track Object with data")
{

View File

@@ -1,11 +1,16 @@
#include "yaml-cpp/binary.h"
#include "yaml-cpp/emitter.h"
#include "yaml-cpp/node/node.h"
#include "yaml-cpp/node/parse.h"
#include <string>
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <kubecontrol/kubecontrol.hpp>
#include <loguru.hpp>
SCENARIO("Testing the SimCore Sensor")
{
@@ -16,9 +21,9 @@ kubecontrol::kubecontrol kc("../docs/config");
kc.createYAML();
kc.startPod();
// kc.getPods();
kc.deletePod("debug-debian");
// kc.deletePod("debug-debian");
kc.getPods();
WHEN("constructing Track Object with data")
{

View File

@@ -1,25 +1,44 @@
#include "kubecontrol/KubePod.hpp"
#include "nlohmann/json_fwd.hpp"
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <kubecontrol/PodController.hpp>
#include <crossguid/guid.hpp>
SCENARIO("Testing the SimCore Sensor")
{
kubecontrol::PodController podc("../docs/config");
kubecontrol::PodController podc("docs/config");
kubecontrol::KubePod pod1("pod1",xg::newGuid().str(),"debugdebianhenry:0.1.3");
kubecontrol::KubePod pod2("pod2",xg::newGuid().str(),"debugdebianhenry:0.1.3");
podc.startPod(pod1);
podc.startPod(pod2);
std::string info1 = "";
info1 = podc.getInfoForPod("pod1");
nlohmann::json j1 = nlohmann::json::parse(info1);
nlohmann::json jall = nlohmann::json::parse(podc.getPodsInfo());
// podc.stopAllPods();
GIVEN("different Attributes for a Track in different forms")
{
LOG_S(INFO)<< podc.getServerAddress();
WHEN("constructing Track Object with data")
{
THEN("check if Track attributes are correct")
{
REQUIRE(true == true);
// REQUIRE(info1 != "");