ADD: added central kubernetes api class

This commit is contained in:
Henry Winkel
2023-12-21 17:15:28 +01:00
parent d1024de907
commit 351cf9ec69
12 changed files with 514 additions and 128 deletions

View File

@@ -42,22 +42,33 @@ std::string uuid = name;
// kubecontrol::KubePod pod2("Pod2",xg::newGuid().str(),"debugdebianhenry:0.1.3");
// pod1.setArgs("-c");
// pod1.setArgs("while true; do echo hello; sleep 5;done");
// pod2.setArgs("-c");
// pod2.setArgs("while true; do echo hello; sleep 5;done");
// pod1.setCommand("/bin/sh");
// pod2.setCommand("/bin/sh");
// podc.startPod(pod2);
LOG_S(INFO)<<"Starting";
podc.startPod(ShipPod1);
// podc.startPod(pod2);
LOG_S(INFO)<<"started";
std::string info1 = "";
info1 = podc.getInfoForPod("hamburg");
nlohmann::json j1 = nlohmann::json::parse(info1);
// info1 = podc.getInfoForPod("hamburg");
// nlohmann::json j1 = nlohmann::json::parse(info1);
nlohmann::json jall = nlohmann::json::parse(podc.getPodsInfo());
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
podc.stopAllPods();
// podc.checkPodsHierarchy();
// LOG_S(INFO)<<podc.PodList_.size();;
// for(auto i: podc.PodList_)
// {
// LOG_S(INFO)<< i.InfoPod.Uuid;
// LOG_S(INFO)<< i.InfoPod.ToString();
// }
// nlohmann::json jall = nlohmann::json::parse(podc.getPodsInfo());
GIVEN("different Attributes for a Track in different forms")
{
@@ -66,8 +77,11 @@ podc.stopAllPods();
THEN("check if Track attributes are correct")
{
REQUIRE(true == true);
REQUIRE(podc.getListOfChildPods() == 1);
LOG_S(INFO)<<"Stopping";
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
podc.stopAllPods();
// REQUIRE(info1 != "");