debut test d'integration, debut module nginx

This commit is contained in:
eleonore12345 2024-08-13 17:54:29 +02:00
parent 80187bd89a
commit 55ae13e45c
5 changed files with 15 additions and 82 deletions

View File

@ -10,7 +10,7 @@
class DockerModule : public Module class DockerModule : public Module
{ {
public: public:
DockerModule();//inline DockerModule();
~DockerModule(){} //inline ~DockerModule(){} //inline
int Prepare (); int Prepare ();
int Deploy (string serviceUsername); int Deploy (string serviceUsername);

View File

@ -2,8 +2,15 @@
#include <string> #include <string>
#include "DockerModule.h" #include "DockerModule.h"
#include "BashModule.h" #include "BashModule.h"
#include "NginxModule.h"
#include "WireguardModule.h"
#include "EncryptionModule.h"
using namespace std; using namespace std;
DockerModule dockerModule=DockerModule(); DockerModule dockerModule=DockerModule();
BashModule bashModule=BashModule(); BashModule bashModule=BashModule();
vector <Module *> modules={&bashModule}; //&dockerModule NginxModule nginxModule=NginxModule();
WireguardModule wireguardModule=WireguardModule();
EncryptionModule encryptionModule=EncryptionModule();
vector <Module *> modules={&bashModule,&nginxModule,&wireguardModule, &encryptionModule}; //&dockerModule

View File

@ -1,77 +0,0 @@
// deployer IntegrationTests main
// Copyright (C) 2024 Jean-Cloud
// GNU General Public License v3
#include <iostream>
#include "BashManager.h"
using namespace std;
void Help()
{
cout << "blabla" << endl;
}
//tests
void environmentTest()
{
cout << "Test of the environment setup." << endl;
}
void bashTest()
{
cout << "Test of BashModule" << endl;
}
void dockerTest()
{
cout << "Test of DockerModule" << endl;
}
void nginxTest()
{
cout << "Test of Nginx module" << endl;
}
void wireguardTest()
{
cout << "Test of WireguardModule" << endl;
}
void encryptionTest()
{
cout << "Test of EncryptionModule" << endl;
}
int main(int argc, char **argv)
{
if(argc!=2){
cerr << "Invalid number of arguments." << endl;
} else{
BashManager::Execute("./deployer deploy all");
string action=argv[1];
if (action=="environment"){
environmentTest();
} else if (action=="bash"){
bashTest();
} else if (action=="docker"){
dockerTest();
} else if (action=="nginx"){
nginxTest();
} else if (action=="wireguard"){
wireguardTest();
} else if (action=="encryption"){
encryptionTest();
} else if (action=="all"){
environmentTest();
bashTest();
dockerTest();
nginxTest();
wireguardTest();
encryptionTest();
} else {
cerr << "Unknown argument." << endl;
Help();
}
}
}

View File

@ -1 +1,3 @@
touch done #!/bin/bash
touch deployResult
echo $(whoami) >> deployResult

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -euo pipefail touch $http_dir/deployAsResult
#git_update.sh -r -d "$HTTP_DIR" "$GIT_SOURCE_REPO" echo $(whoami) >> $http_dir/deployResult