From fe8549dc37ef6e003b120f9b328d85337756edf4 Mon Sep 17 00:00:00 2001
From: Lukasz Lopatowski <llopat@man.poznan.pl>
Date: Tue, 16 Mar 2021 16:21:54 +0100
Subject: [PATCH] Removed not used init scripts and data

---
 .../inventory/kubernetes/kubernetes-1.json    | 36 -------------
 src/test/shell/init.bat                       |  2 +-
 src/test/shell/init.sh                        |  2 +-
 src/test/shell/populate-inventory.bat         | 52 -------------------
 src/test/shell/populate-inventory.sh          | 24 ---------
 5 files changed, 2 insertions(+), 114 deletions(-)
 delete mode 100644 src/test/shell/data/inventory/kubernetes/kubernetes-1.json
 delete mode 100644 src/test/shell/populate-inventory.bat
 delete mode 100644 src/test/shell/populate-inventory.sh

diff --git a/src/test/shell/data/inventory/kubernetes/kubernetes-1.json b/src/test/shell/data/inventory/kubernetes/kubernetes-1.json
deleted file mode 100644
index 25e8b12d1..000000000
--- a/src/test/shell/data/inventory/kubernetes/kubernetes-1.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
-  "ingress": {
-    "controllerConfigOption":"USE_EXISTING",
-    "supportedIngressClass":"nginx",
-    "publicIngressClass":"public",
-    "controllerChartName":"nginx",
-    "controllerChartArchive":"nginx-ingress.tgz",
-    "resourceConfigOption":"DEPLOY_FROM_CHART",
-    "externalServiceDomain":"nmaas.geant.net",
-    "publicServiceDomain":"public.nmaas.geant.net",
-    "tlsSupported":false,
-    "certificateConfigOption": "USE_LETSENCRYPT",
-    "issuerOrWildcardName": "nmaas-issuer",
-    "ingressPerDomain": false
-  },
-  "deployment": {
-    "namespaceConfigOption":"USE_DEFAULT_NAMESPACE",
-    "defaultNamespace":"default",
-    "defaultStorageClass":"nmaas-nfs-storage",
-    "forceDedicatedWorkers":false,
-    "smtpServerHostname": "nmaas-postfix.nmaas-system",
-    "smtpServerPort": "587"
-  },
-  "externalNetworks": [{
-      "externalIp":"169.10.10.10",
-      "externalNetwork":"169.10.10.0",
-      "externalNetworkMaskLength":24,
-      "assigned":false
-    }, {
-      "externalIp":"169.10.20.20",
-      "externalNetwork":"169.10.20.0",
-      "externalNetworkMaskLength":24,
-      "assigned":false
-    }
-  ]
-}
diff --git a/src/test/shell/init.bat b/src/test/shell/init.bat
index ecb51bcce..48cba4126 100644
--- a/src/test/shell/init.bat
+++ b/src/test/shell/init.bat
@@ -58,7 +58,7 @@ echo
 echo ---------------------
 echo
 echo Default mail template
-curl -X POST --header "Authorization: Bearer %token%" -F "file=@data\mails\html-template\template.html;type=text/html" %API_URL%/mail/templates/html
+curl -X POST %API_URL%/mail/templates/html --header "Authorization: Bearer %token%" -F "file=@data\mails\html-template\template.html;type=text/html"
 echo.
 echo
 echo Create mail templates
diff --git a/src/test/shell/init.sh b/src/test/shell/init.sh
index e7212421a..1efc051d1 100644
--- a/src/test/shell/init.sh
+++ b/src/test/shell/init.sh
@@ -26,7 +26,7 @@ echo
 curl -X GET $API_URL/domains --header "Authorization: Bearer $TOKEN" | python -m json.tool
 echo
 echo Default mail template
-curl -X POST --header "Authorization: Bearer $TOKEN" -F "file=@data/mails/html-template/template.html;type=text/html" $API_URL/mail/templates/html
+curl -X POST $API_URL/mail/templates/html --header "Authorization: Bearer $TOKEN" -F "file=@data/mails/html-template/template.html;type=text/html"
 echo
 echo Create mail templates
 curl -X POST $API_URL/mail/templates --header "Authorization: Bearer $TOKEN" --header "Content-Type: application/json" --header "Accept: application/json" -d @data/mails/activateAccountMail.json
diff --git a/src/test/shell/populate-inventory.bat b/src/test/shell/populate-inventory.bat
deleted file mode 100644
index ffc68e779..000000000
--- a/src/test/shell/populate-inventory.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-@echo off
-setlocal enableDelayedExpansion
-@echo off
-setlocal enableDelayedExpansion
-
-set API_URL=http://localhost:9000/api
-echo %API_URL%
-
-set LF=^
-
-
-
-for /f "delims=" %%f in ('curl -sX POST %API_URL%/auth/basic/login --header "Content-Type: application/json" --header "Accept: application/json" -d @data\login.json') do (
-REM set "LOGIN="
-	if defined LOGIN set "LOGIN=!LOGIN!!LF!"
-	set "LOGIN=!LOGIN!%%f"
-)
-
-rem echo Output: !LOGIN!
-REM ref: http://stackoverflow.com/questions/36374496/parse-simple-json-string-in-batch
-set LOGIN=%LOGIN:"=%
-echo stage 1 - %LOGIN%
-echo ---
-set "LOGIN=%LOGIN:~1,-1%"
-echo stage 2 - %LOGIN%
-echo ---
-set "LOGIN=%LOGIN::==%"
-echo stage 3 - !LOGIN!
-echo ---
-
-FOR /F "delims=," %%a in ("!LOGIN!") do (
-  echo Found: %%a
-  set "%%a"
-  echo --
-)
-
-rem echo !LOGIN!
-
-rem set token=%LOGIN%
-
-echo Token:
-echo ----------------------
-echo %token%
-echo ----------------------
-echo Ping
-curl -X GET %API_URL%/auth/basic/ping --header "Authorization: Bearer %token%"
-
-echo.
-echo Adding default Kubernetes
-curl -X POST %API_URL%/management/kubernetes --header "Authorization: Bearer %token%" --header "Content-Type: application/json" --header "Accept: application/json" -d @data\inventory\kubernetes\kubernetes-1.json
-echo
-curl -X GET %API_URL%/management/kubernetes --header "Authorization: Bearer %token%"
diff --git a/src/test/shell/populate-inventory.sh b/src/test/shell/populate-inventory.sh
deleted file mode 100644
index 3deddb387..000000000
--- a/src/test/shell/populate-inventory.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-function getToken() {
-	python -c "import json,sys;sys.stdout.write(json.dumps(json.load(sys.stdin)['token']))" | sed -e 's/^"//' -e 's/"$//'
-}
-
-API_URL=http://localhost:9000/api
-echo Base API URL $API_URL
-
-TOKEN=`curl -sX POST $API_URL/auth/basic/login --header "Content-Type: application/json" --header "Accept: application/json" -d @data/login.json | getToken`
-
-
-echo Token:
-echo ----------------------
-echo $TOKEN
-echo ----------------------
-echo Ping
-curl -X GET $API_URL/auth/basic/ping --header "Authorization: Bearer $TOKEN"
-
-echo
-echo Adding default Kubernetes cluster
-curl -X POST $API_URL/management/kubernetes --header "Authorization: Bearer $TOKEN" --header "Content-Type: application/json" --header "Accept: application/json" -d @data/inventory/kubernetes/kubernetes-1.json
-echo
-curl -X GET $API_URL/management/kubernetes --header "Authorization: Bearer $TOKEN" | python -m json.tool
-- 
GitLab