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
{
public:
DockerModule();//inline
DockerModule();
~DockerModule(){} //inline
int Prepare ();
int Deploy (string serviceUsername);

View File

@ -2,8 +2,15 @@
#include <string>
#include "DockerModule.h"
#include "BashModule.h"
#include "NginxModule.h"
#include "WireguardModule.h"
#include "EncryptionModule.h"
using namespace std;
DockerModule dockerModule=DockerModule();
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
set -euo pipefail
#git_update.sh -r -d "$HTTP_DIR" "$GIT_SOURCE_REPO"
touch $http_dir/deployAsResult
echo $(whoami) >> $http_dir/deployResult