From c6d2aa665af0664eb681820a1b70c0ad47000c08 Mon Sep 17 00:00:00 2001 From: Michele Sciabarra Date: Wed, 13 Sep 2023 17:25:05 +0100 Subject: [PATCH] updating env.dist --- .env.dist | 8 ++ .gitignore | 2 +- CISETUP.md | 2 +- Taskfile.yml | 1 - env.dist | 8 -- tests/1-deploy.cmd | 107 ------------------------- tests/10-user-minio.cmd | 121 ---------------------------- tests/11-nuv-win.cmd | 22 ------ tests/2-ssl.cmd | 54 ------------- tests/3-sys-redis.cmd | 32 -------- tests/4a-sys-ferretdb.cmd | 35 -------- tests/4b-sys-postgres.cmd | 35 -------- tests/5-sys-minio.cmd | 35 -------- tests/6-login.cmd | 90 --------------------- tests/7-static.cmd | 68 ---------------- tests/8-user-redis.cmd | 122 ---------------------------- tests/9a-user-ferretdb.cmd | 114 -------------------------- tests/9b-user-postgres.cmd | 114 -------------------------- tests/all.cmd | 158 ------------------------------------- 19 files changed, 10 insertions(+), 1118 deletions(-) create mode 100644 .env.dist delete mode 100644 env.dist delete mode 100644 tests/1-deploy.cmd delete mode 100644 tests/10-user-minio.cmd delete mode 100755 tests/11-nuv-win.cmd delete mode 100644 tests/2-ssl.cmd delete mode 100644 tests/3-sys-redis.cmd delete mode 100644 tests/4a-sys-ferretdb.cmd delete mode 100644 tests/4b-sys-postgres.cmd delete mode 100644 tests/5-sys-minio.cmd delete mode 100644 tests/6-login.cmd delete mode 100644 tests/7-static.cmd delete mode 100644 tests/8-user-redis.cmd delete mode 100644 tests/9a-user-ferretdb.cmd delete mode 100644 tests/9b-user-postgres.cmd delete mode 100644 tests/all.cmd diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..34e454d --- /dev/null +++ b/.env.dist @@ -0,0 +1,8 @@ +ID_RSA_B64=testing: base64 of vm ids output of cat ~/.ssh/id_rsa | base64 -w0 +AWS_CLUSTER_NAME=testing: name of EKS cluster +AWS_DEFAULT_KEY_NAME=testing: name of AWS key +AWS_ACCESS_KEY_ID=testing: access key +AWS_SECRET_ACCESS_KEY=testing: secret key +GKE_PROJECT=testing: gcloud project +AKS_CLUSTER_NAME=testing: Azure AKS cluster name +OSH_KUBEADMIN_PASSWORD=testing: openshift kubeadmin password diff --git a/.gitignore b/.gitignore index fad569d..7c2a426 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,4 @@ conf/gcp conf/aws kubeconfig env-github -.env +.env* diff --git a/CISETUP.md b/CISETUP.md index 069a535..c303432 100644 --- a/CISETUP.md +++ b/CISETUP.md @@ -1,6 +1,6 @@ # Recover access to the CI environemt -- Copy `env.dist` in `.env` and put the secrets in it +- Copy `.env.dist` in `.env` and put the secrets in it ## Access to the clusters diff --git a/Taskfile.yml b/Taskfile.yml index 7276457..40e3c94 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -192,7 +192,6 @@ tasks: - task: upload-secrets-vm - task: upload-secrets-kube - test-ci: | git tag {{.N}}-{{.NOW}} git push origin --tags diff --git a/env.dist b/env.dist deleted file mode 100644 index 5bca4d9..0000000 --- a/env.dist +++ /dev/null @@ -1,8 +0,0 @@ -ID_RSA_B64= -AWS_DEFAULT_KEY_NAME= -AWS_CLUSTER_NAME= -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -GKE_PROJECT= -AKS_CLUSTER_NAME= -OSH_KUBEADMIN_PASSWORD= diff --git a/tests/1-deploy.cmd b/tests/1-deploy.cmd deleted file mode 100644 index 774374e..0000000 --- a/tests/1-deploy.cmd +++ /dev/null @@ -1,107 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET "TYPE=%~1" -IF "%TYPE%"=="" ( - ECHO test type parameter is missing. - EXIT /B 1 -) - -FOR /F "tokens=1 delims=-" %%A IN ("%TYPE%") DO SET "TYPE=%%A" - -:: actual setup -IF "%TYPE%"=="kind" ( - :: create vm with docker - nuv config reset - nuv setup devcluster --uninstall - nuv setup devcluster -) ELSE IF "%TYPE%"=="k3s" ( - :: create vm and install in the server - nuv config reset - task aws:config - :: create vm without k3s - nuv cloud aws vm-create k3s-test - nuv cloud aws zone-update k3s.nuvtest.net --wildcard --vm=k3s-test - nuv cloud aws vm-getip k3s-test >_ip - :: install nuvolaris - nuv setup server %_ip% ubuntu --uninstall - nuv setup server %_ip% ubuntu -) ELSE IF "%TYPE%"=="mk8s" ( - nuv config reset - task aws:config - :: create vm with mk8s - nuv cloud aws vm-create mk8s-test - nuv cloud aws zone-update mk8s.nuvtest.net --wildcard --vm=mk8s-test - nuv cloud aws vm-getip mk8s-test >_ip - nuv cloud mk8s create SERVER=%_ip% USERNAME=ubuntu - nuv cloud mk8s kubeconfig SERVER=%_ip% USERNAME=ubuntu - :: install cluster - nuv setup cluster --uninstall - nuv setup cluster -) ELSE IF "%TYPE%"=="eks" ( - nuv config reset - :: create cluster - task aws:config - task eks:config - nuv cloud eks create - nuv cloud eks kubeconfig - nuv cloud eks lb >_cname - nuv cloud aws zone-update eks.nuvtest.net --wildcard --cname=%_cname% - :: on eks we need to setup an initial apihost resolving the NLB hostname - nuv config apihost nuvolaris.eks.nuvtest.net - :: install cluster - nuv setup cluster --uninstall - nuv setup cluster -) ELSE IF "%TYPE%"=="aks" ( - nuv config reset - :: create cluster - task aks:config - nuv cloud aks create - SETLOCAL ENABLEDELAYEDEXPANSION - FOR /F "usebackq tokens=*" %%A IN (`nuv cloud aks lb`) DO SET "IP=%%A" - ENDLOCAL & SET "IP=%IP%" - nuv cloud aws zone-update aks.nuvtest.net --wildcard --ip %IP% - :: install cluster - nuv setup cluster --uninstall - nuv setup cluster -) ELSE IF "%TYPE%"=="gke" ( - nuv config reset - :: create cluster - task gke:config - nuv cloud gke create - nuv cloud gke kubeconfig - - task aws:config - SETLOCAL ENABLEDELAYEDEXPANSION - FOR /F "usebackq tokens=*" %%A IN (`nuv cloud gke lb`) DO SET "IP=%%A" - ENDLOCAL & SET "IP=%IP%" - nuv cloud aws zone-update gke.nuvtest.net --wildcard --ip %IP% - - :: install cluster - nuv setup cluster --uninstall - nuv setup cluster -) ELSE IF "%TYPE%"=="osh" ( - nuv config reset - :: create cluster - task osh:create - nuv cloud osh import conf/osh/auth/kubeconfig - - :: install cluster - nuv setup cluster --uninstall - nuv setup cluster -) \ No newline at end of file diff --git a/tests/10-user-minio.cmd b/tests/10-user-minio.cmd deleted file mode 100644 index f14553d..0000000 --- a/tests/10-user-minio.cmd +++ /dev/null @@ -1,121 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. -@echo off - -setlocal enabledelayedexpansion - -set "TYPE=%~1" -if "%TYPE%"=="" ( - echo test type parameter is missing. - exit /b 1 -) - -for /f "tokens=1 delims=-" %%a in ("%TYPE%") do set "TYPE=%%a" - -nuv config status | find "NUVOLARIS_MINIO=true" > nul -if not errorlevel 1 ( - echo MINIO ENABLED -) else ( - echo MINIO DISABLED - SKIPPING - exit /b 0 -) - -set "user=demominiouser" - -for /f "usebackq tokens=* delims=" %%a in (`nuv -random --str 12`) do set "password=%%a" - -nuv admin adduser %user% %user%@email.com %password% --minio | find "whiskuser.nuvolaris.org/%user% created" > nul -if not errorlevel 1 ( - echo SUCCESS CREATING %user% -) else ( - echo FAIL CREATING %user% - exit /b 1 -) - -nuv debug kube ctl CMD="wait --for=condition=ready --timeout=60s -n nuvolaris wsku/%user%" - -set "LOGIN_COMMAND=" -set "APIURL=http://localhost:3233" -if "%TYPE%"=="kind" ( - set "LOGIN_COMMAND=nuv -login %APIURL% | find "Successfully logged in as %user%." > nul" -) else ( - for /f "tokens=4" %%a in ('nuv debug apihost ^| find "whisk API host"') do set "APIURL=%%a" - set "LOGIN_COMMAND=NUV_LOGIN=%user% NUV_PASSWORD=%password% nuv -login !APIURL! | find "Successfully logged in as %user%." > nul" -) - -rem Use delayed expansion for variable expansion inside the block -setlocal enabledelayedexpansion -if "%TYPE%"=="kind" ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) else ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) -endlocal - -nuv setup nuvolaris minio | find "hello" > nul -if not errorlevel 1 ( - echo SUCCESS SETUP MINIO ACTION -) else ( - echo FAIL SETUP MINIO ACTION - exit /b 1 -) - -nuv -wsk action list | find "/%user%/hello/minio" > nul -if not errorlevel 1 ( - echo SUCCESS USER MINIO ACTION LIST -) else ( - echo FAIL USER MINIO ACTION LIST - exit /b 1 -) - -for /f "tokens=* delims=" %%a in ('nuv -config MINIO_ACCESS_KEY') do set "MINIO_ACCESS_KEY=%%a" -for /f "tokens=* delims=" %%a in ('nuv -config MINIO_SECRET_KEY') do set "MINIO_SECRET_KEY=%%a" -for /f "tokens=* delims=" %%a in ('nuv -config MINIO_HOST') do set "MINIO_HOST=%%a" -for /f "tokens=* delims=" %%a in ('nuv -config MINIO_PORT') do set "MINIO_PORT=%%a" -for /f "tokens=* delims=" %%a in ('nuv -config MINIO_DATA_BUCKET') do set "MINIO_DATA_BUCKET=%%a" - -if not defined MINIO_ACCESS_KEY ( - echo FAIL USER MINIO_ACCESS_KEY - exit /b 1 -) else ( - echo SUCCESS USER MINIO_ACCESS_KEY -) - -nuv -wsk action invoke hello/minio -p minio_access "%MINIO_ACCESS_KEY%" ^ - -p minio_secret "%MINIO_SECRET_KEY%" ^ - -p minio_host "%MINIO_HOST%" ^ - -p minio_port "%MINIO_PORT%" ^ - -p minio_data "%MINIO_DATA_BUCKET%" -r | find "%user%-data" > nul -if not errorlevel 1 ( - echo SUCCESS - exit /b 0 -) else ( - echo FAIL - exit /b 1 -) diff --git a/tests/11-nuv-win.cmd b/tests/11-nuv-win.cmd deleted file mode 100755 index 7c4814f..0000000 --- a/tests/11-nuv-win.cmd +++ /dev/null @@ -1,22 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@echo off -setlocal - -set "TYPE=%1" -call "%~dp0\windows\all.cmd" %TYPE% \ No newline at end of file diff --git a/tests/2-ssl.cmd b/tests/2-ssl.cmd deleted file mode 100644 index 82b5760..0000000 --- a/tests/2-ssl.cmd +++ /dev/null @@ -1,54 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF -SET "TYPE=%~1" -SET "EMAIL=msciabarra@apache.org" - -IF "%TYPE%"=="" ( - ECHO test type parameter is missing. - EXIT /B 1 -) - -IF "%TYPE%"=="kind" ( - ECHO SKIPPING - EXIT /B 1 -) - -FOR /F %%A IN ('nuv -random --str 5') DO SET "rn=%%A" - -IF "%TYPE%"=="osh" ( - REM configure - nuv config apihost api.apps.nuvolaris.osh.nuvtest.net --tls %EMAIL% - nuv update apply -) ELSE ( - nuv config reset - REM task aws:config - - REM configure - nuv config apihost %rn%.%TYPE%.nuvtest.net --tls %EMAIL% - nuv update apply -) - -REM check we have https -FOR /F "tokens=* USEBACKQ" %%L IN (`nuv debug status ^| FIND "apihost: https://"`) DO ( - ECHO SUCCESS - EXIT /B 0 -) - -ECHO FAIL -EXIT /B 1 \ No newline at end of file diff --git a/tests/3-sys-redis.cmd b/tests/3-sys-redis.cmd deleted file mode 100644 index c53c447..0000000 --- a/tests/3-sys-redis.cmd +++ /dev/null @@ -1,32 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@ECHO OFF - -:: Configure -nuv config enable --redis -nuv update apply -nuv setup nuvolaris wait-cm JSONPATH="{.metadata.annotations.redis_prefix}" - -:: Check if "hello" exists in the output of "nuv setup nuvolaris redis" -FOR /F "tokens=* USEBACKQ" %%L IN (`nuv setup nuvolaris redis ^| FIND "hello"`) DO ( - ECHO SUCCESS - EXIT /B 0 -) - -ECHO FAIL -EXIT /B 1 diff --git a/tests/4a-sys-ferretdb.cmd b/tests/4a-sys-ferretdb.cmd deleted file mode 100644 index 50e77b9..0000000 --- a/tests/4a-sys-ferretdb.cmd +++ /dev/null @@ -1,35 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -nuv config enable --mongo -nuv update apply -nuv setup nuvolaris wait-cm JSONPATH="{.metadata.annotations.mongodb_url}" - -nuv config status | find "NUVOLARIS_MONGODB=true" > nul -if errorlevel 1 ( - echo SKIPPING - exit /b 0 -) else ( - nuv setup nuvolaris mongodb | find "hello" > nul - if not errorlevel 1 ( - echo SUCCESS - exit /b 0 - ) else ( - echo FAIL - exit /b 1 - ) -) diff --git a/tests/4b-sys-postgres.cmd b/tests/4b-sys-postgres.cmd deleted file mode 100644 index 8e0bdd9..0000000 --- a/tests/4b-sys-postgres.cmd +++ /dev/null @@ -1,35 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -nuv config enable --postgres -nuv update apply -nuv setup nuvolaris wait-cm JSONPATH="{.metadata.annotations.postgres_url}" - -nuv config status | find "NUVOLARIS_POSTGRES=true" > nul -if errorlevel 1 ( - echo SKIPPING - exit /b 0 -) else ( - nuv setup nuvolaris postgres | find "Nuvolaris Postgres is up and running!" > nul - if not errorlevel 1 ( - echo SUCCESS - exit /b 0 - ) else ( - echo FAIL - exit /b 1 - ) -) diff --git a/tests/5-sys-minio.cmd b/tests/5-sys-minio.cmd deleted file mode 100644 index e3ca885..0000000 --- a/tests/5-sys-minio.cmd +++ /dev/null @@ -1,35 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -nuv config enable --minio -nuv update apply -nuv setup nuvolaris wait-cm JSONPATH="{.metadata.annotations.minio_bucket_data}" - -nuv config status | find "NUVOLARIS_MINIO=true" > nul -if errorlevel 1 ( - echo SKIPPING - exit /b 0 -) else ( - nuv setup nuvolaris minio | find "nuvolaris-data" > nul - if not errorlevel 1 ( - echo SUCCESS - exit /b 0 - ) else ( - echo FAIL - exit /b 1 - ) -) diff --git a/tests/6-login.cmd b/tests/6-login.cmd deleted file mode 100644 index 23e8da4..0000000 --- a/tests/6-login.cmd +++ /dev/null @@ -1,90 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. -@echo off - -setlocal enabledelayedexpansion - -set "TYPE=%~1" -if "%TYPE%"=="" ( - echo test type parameter is missing. - exit /b 1 -) - -for /f "tokens=1 delims=-" %%a in ("%TYPE%") do set "TYPE=%%a" - -rem Generate a random password for the user "demo" -for /f "usebackq tokens=* delims=" %%a in (`nuv -random --str 12`) do set "password=%%a" -set "user=demouser" - -set "ENABLE_REDIS=" -nuv config status | find "NUVOLARIS_REDIS=true" > nul -if not errorlevel 1 set "ENABLE_REDIS=--redis" - -set "ENABLE_MONGODB=" -nuv config status | find "NUVOLARIS_MONGODB=true" > nul -if not errorlevel 1 set "ENABLE_MONGODB=--mongodb" - -set "ENABLE_MINIO=" -nuv config status | find "NUVOLARIS_MINIO=true" > nul -if not errorlevel 1 set "ENABLE_MINIO=--minio" - -set "ENABLE_POSTGRES=" -nuv config status | find "NUVOLARIS_POSTGRES=true" > nul -if not errorlevel 1 set "ENABLE_POSTGRES=--postgres" - -rem Create a new user "demo-user" with nuv admin adduser with previous services enabled -nuv admin adduser %user% demo@email.com %password% %ENABLE_REDIS% %ENABLE_MONGODB% %ENABLE_MINIO% %ENABLE_POSTGRES% | find "whiskuser.nuvolaris.org/%user% created" > nul -if not errorlevel 1 ( - echo SUCCESS CREATING %user% -) else ( - echo FAIL CREATING %user% - exit /b 1 -) - -set "APIURL=http://localhost:3233" -rem if type is not kind, get the APIURL from nuv debug apihost -if not "%TYPE%"=="kind" ( - for /f "tokens=4" %%a in ('nuv debug apihost ^| find "whisk API host"') do set "APIURL=%%a" -) - -echo %APIURL% -set "NUV_LOGIN=%user%" -set "NUV_PASSWORD=%password%" -nuv -login %APIURL% | find "Successfully logged in as %user%." > nul -if not errorlevel 1 ( - echo SUCCESS LOGIN -) else ( - echo FAIL LOGIN - exit /b 1 -) - -nuv setup nuvolaris hello | find "hello" > nul -if not errorlevel 1 ( - echo SUCCESS -) else ( - echo FAIL - exit /b 1 -) - -nuv -wsk action list | find "/%user%/hello/hello" > nul -if not errorlevel 1 ( - echo SUCCESS - exit /b 0 -) else ( - echo FAIL - exit /b 1 -) diff --git a/tests/7-static.cmd b/tests/7-static.cmd deleted file mode 100644 index 3bd6f5d..0000000 --- a/tests/7-static.cmd +++ /dev/null @@ -1,68 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. -@echo off - -setlocal enabledelayedexpansion - -set "TYPE=%~1" -if "%TYPE%"=="" ( - echo test type parameter is missing. - exit /b 1 -) - -for /f "tokens=1 delims=-" %%a in ("%TYPE%") do set "TYPE=%%a" - -nuv config enable --minio --static -nuv update apply -nuv debug kube ctl CMD="wait --for=condition=ready --timeout=60s -n nuvolaris pod/nuvolaris-static-0" - -set "user=demostaticuser" - -for /f "usebackq tokens=* delims=" %%a in (`nuv -random --str 12`) do set "password=%%a" - -nuv admin adduser %user% %user%@email.com %password% --minio | find "whiskuser.nuvolaris.org/%user% created" > nul -if not errorlevel 1 ( - echo SUCCESS CREATING %user% -) else ( - echo FAIL CREATING %user% - exit /b 1 -) - -nuv debug kube ctl CMD="wait --for=condition=ready --timeout=60s -n nuvolaris wsku/%user%" - -for /f "tokens=4 delims=[/:" %%a in ('nuv debug apihost ^| find "whisk API host"') do set "API_PROTOCOL=%%a" -for /f "tokens=4 delims=[/:]" %%a in ('nuv debug apihost ^| find "whisk API host"') do set "API_DOMAIN=%%a" - -if "%TYPE%"=="osh" ( - for /f "usebackq tokens=* delims=" %%a in ('nuv debug kube wait OBJECT=route.route.openshift.io/%user%-static-route JSONPATH="{.status.ingress[0].host}"') do set "STATIC_URL=%%a" -) else ( - for /f "usebackq tokens=* delims=" %%a in ('nuv debug kube wait OBJECT=ingress/%user%-static-ingress JSONPATH="{.status.loadBalancer.ingress[0]}"') do set "STATIC_URL=%%a" -) - -if "%TYPE%"=="kind" ( - echo SUCCESS STATIC FOR LOCALHOST IS SKIPPED -) else ( - set "STATIC_URL=!API_PROTOCOL!://!user!.!API_DOMAIN!" - echo testing using !STATIC_URL! - curl --insecure !STATIC_URL! | find "Welcome to Nuvolaris static content distributor landing page!!!" > nul - if not errorlevel 1 ( - echo SUCCESS STATIC - ) else ( - echo FAIL STATIC - exit /b 1 - ) -) diff --git a/tests/8-user-redis.cmd b/tests/8-user-redis.cmd deleted file mode 100644 index 0b97316..0000000 --- a/tests/8-user-redis.cmd +++ /dev/null @@ -1,122 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@echo off - -setlocal enabledelayedexpansion - -set "TYPE=%~1" -if "%TYPE%"=="" ( - echo test type parameter is missing. - exit /b 1 -) - -for /f "tokens=1 delims=-" %%a in ("%TYPE%") do set "TYPE=%%a" - -nuv config status | find "NUVOLARIS_REDIS=true" > nul -if not errorlevel 1 ( - echo REDIS ENABLED -) else ( - echo REDIS DISABLED - SKIPPING - exit /b 0 -) - -set "user=demoredisuser" - -for /f "usebackq tokens=* delims=" %%a in (`nuv -random --str 12`) do set "password=%%a" - -nuv admin adduser %user% %user%@email.com %password% --redis | find "whiskuser.nuvolaris.org/%user% created" > nul -if not errorlevel 1 ( - echo SUCCESS CREATING %user% -) else ( - echo FAIL CREATING %user% - exit /b 1 -) - -nuv debug kube ctl CMD="wait --for=condition=ready --timeout=60s -n nuvolaris wsku/%user%" - -set "LOGIN_COMMAND=" -set "APIURL=http://localhost:3233" -if "%TYPE%"=="kind" ( - set "LOGIN_COMMAND=nuv -login %APIURL% | find "Successfully logged in as %user%." > nul" -) else ( - for /f "tokens=4" %%a in ('nuv debug apihost ^| find "whisk API host"') do set "APIURL=%%a" - set "LOGIN_COMMAND=NUV_LOGIN=%user% NUV_PASSWORD=%password% nuv -login !APIURL! | find "Successfully logged in as %user%." > nul" -) - -rem Use delayed expansion for variable expansion inside the block -setlocal enabledelayedexpansion -if "%TYPE%"=="kind" ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) else ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) -endlocal - -nuv setup nuvolaris redis | find "hello" > nul -if not errorlevel 1 ( - echo SUCCESS SETUP REDIS ACTION -) else ( - echo FAIL SETUP REDIS ACTION - exit /b 1 -) - -nuv -wsk action list | find "/%user%/hello/redis" > nul -if not errorlevel 1 ( - echo SUCCESS USER REDIS ACTION LIST -) else ( - echo FAIL USER REDIS ACTION LIST - exit /b 1 -) - -for /f "tokens=* delims=" %%a in ('nuv -config REDIS_URL') do set "REDIS_URL=%%a" -for /f "tokens=* delims=" %%a in ('nuv -config REDIS_PREFIX') do set "REDIS_PREFIX=%%a" - -if not defined REDIS_URL ( - echo FAIL REDIS_URL - exit /b 1 -) else ( - echo SUCCESS REDIS_URL -) - -if not defined REDIS_PREFIX ( - echo FAIL REDIS_PREFIX - exit /b 1 -) else ( - echo SUCCESS REDIS_PREFIX -) - -nuv -wsk action invoke hello/redis -p redis_url "%REDIS_URL%" -p redis_prefix "%REDIS_PREFIX%" -r | find "hello" > nul -if not errorlevel 1 ( - echo SUCCESS - exit /b 0 -) else ( - echo FAIL - exit /b 1 -) diff --git a/tests/9a-user-ferretdb.cmd b/tests/9a-user-ferretdb.cmd deleted file mode 100644 index 93ca2e9..0000000 --- a/tests/9a-user-ferretdb.cmd +++ /dev/null @@ -1,114 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@echo off - -setlocal enabledelayedexpansion - -set "TYPE=%~1" -if "%TYPE%"=="" ( - echo test type parameter is missing. - exit /b 1 -) - -for /f "tokens=1 delims=-" %%a in ("%TYPE%") do set "TYPE=%%a" - -nuv config status | find "NUVOLARIS_MONGODB=true" > nul -if not errorlevel 1 ( - echo MONGODB ENABLED -) else ( - echo MONGODB DISABLED - SKIPPING - exit /b 0 -) - -set "user=demomongouser" - -for /f "usebackq tokens=* delims=" %%a in (`nuv -random --str 12`) do set "password=%%a" - -nuv admin adduser %user% %user%@email.com %password% --mongodb | find "whiskuser.nuvolaris.org/%user% created" > nul -if not errorlevel 1 ( - echo SUCCESS CREATING %user% -) else ( - echo FAIL CREATING %user% - exit /b 1 -) - -nuv debug kube ctl CMD="wait --for=condition=ready --timeout=60s -n nuvolaris wsku/%user%" - -set "LOGIN_COMMAND=" -set "APIURL=http://localhost:3233" -if "%TYPE%"=="kind" ( - set "LOGIN_COMMAND=nuv -login %APIURL% | find "Successfully logged in as %user%." > nul" -) else ( - for /f "tokens=4" %%a in ('nuv debug apihost ^| find "whisk API host"') do set "APIURL=%%a" - set "LOGIN_COMMAND=NUV_LOGIN=%user% NUV_PASSWORD=%password% nuv -login !APIURL! | find "Successfully logged in as %user%." > nul" -) - -rem Use delayed expansion for variable expansion inside the block -setlocal enabledelayedexpansion -if "%TYPE%"=="kind" ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) else ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) -endlocal - -nuv setup nuvolaris mongodb | find "hello" > nul -if not errorlevel 1 ( - echo SUCCESS SETUP MONGODB ACTION -) else ( - echo FAIL SETUP MONGODB ACTION - exit /b 1 -) - -nuv -wsk action list | find "/%user%/hello/mongodb" > nul -if not errorlevel 1 ( - echo SUCCESS USER MONGODB ACTION LIST -) else ( - echo FAIL USER MONGODB ACTION LIST - exit /b 1 -) - -for /f "tokens=* delims=" %%a in ('nuv -config MONGODB_URL') do set "MONGODB_URL=%%a" - -if not defined MONGODB_URL ( - echo FAIL USER MONGODB_URL - exit /b 1 -) else ( - echo SUCCESS USER MONGODB_URL -) - -nuv -wsk action invoke hello/mongodb -p mongodb_url "%MONGODB_URL%" -r | find "hello" > nul -if not errorlevel 1 ( - echo SUCCESS - exit /b 0 -) else ( - echo FAIL - exit /b 1 -) diff --git a/tests/9b-user-postgres.cmd b/tests/9b-user-postgres.cmd deleted file mode 100644 index 9c65e93..0000000 --- a/tests/9b-user-postgres.cmd +++ /dev/null @@ -1,114 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@echo off - -setlocal enabledelayedexpansion - -set "TYPE=%~1" -if "%TYPE%"=="" ( - echo test type parameter is missing. - exit /b 1 -) - -for /f "tokens=1 delims=-" %%a in ("%TYPE%") do set "TYPE=%%a" - -nuv config status | find "NUVOLARIS_POSTGRES=true" > nul -if not errorlevel 1 ( - echo POSTGRES ENABLED -) else ( - echo POSTGRES DISABLED - SKIPPING - exit /b 0 -) - -set "user=demopostgresuser" - -for /f "usebackq tokens=* delims=" %%a in (`nuv -random --str 12`) do set "password=%%a" - -nuv admin adduser %user% %user%@email.com %password% --postgres | find "whiskuser.nuvolaris.org/%user% created" > nul -if not errorlevel 1 ( - echo SUCCESS CREATING %user% -) else ( - echo FAIL CREATING %user% - exit /b 1 -) - -nuv debug kube ctl CMD="wait --for=condition=ready --timeout=60s -n nuvolaris wsku/%user%" - -set "LOGIN_COMMAND=" -set "APIURL=http://localhost:3233" -if "%TYPE%"=="kind" ( - set "LOGIN_COMMAND=nuv -login %APIURL% | find "Successfully logged in as %user%." > nul" -) else ( - for /f "tokens=4" %%a in ('nuv debug apihost ^| find "whisk API host"') do set "APIURL=%%a" - set "LOGIN_COMMAND=NUV_LOGIN=%user% NUV_PASSWORD=%password% nuv -login !APIURL! | find "Successfully logged in as %user%." > nul" -) - -rem Use delayed expansion for variable expansion inside the block -setlocal enabledelayedexpansion -if "%TYPE%"=="kind" ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) else ( - !LOGIN_COMMAND! - if not errorlevel 1 ( - echo SUCCESS LOGIN - ) else ( - echo FAIL LOGIN - exit /b 1 - ) -) -endlocal - -nuv setup nuvolaris postgres | find "Nuvolaris Postgres is up and running!" > nul -if not errorlevel 1 ( - echo SUCCESS SETUP POSTGRES ACTION -) else ( - echo FAIL SETUP POSTGRES ACTION - exit /b 1 -) - -nuv -wsk action list | find "/%user%/hello/postgres" > nul -if not errorlevel 1 ( - echo SUCCESS USER POSTGRES ACTION LIST -) else ( - echo FAIL USER POSTGRES ACTION LIST - exit /b 1 -) - -for /f "tokens=* delims=" %%a in ('nuv -config POSTGRES_URL') do set "POSTGRES_URL=%%a" - -if not defined POSTGRES_URL ( - echo FAIL USER POSTGRES_URL - exit /b 1 -) else ( - echo SUCCESS USER POSTGRES_URL -) - -nuv -wsk action invoke hello/postgres -p dburi "%POSTGRES_URL%" -r | find "Nuvolaris Postgres is up and running!" > nul -if not errorlevel 1 ( - echo SUCCESS - exit /b 0 -) else ( - echo FAIL - exit /b 1 -) diff --git a/tests/all.cmd b/tests/all.cmd deleted file mode 100644 index ab8d2d3..0000000 --- a/tests/all.cmd +++ /dev/null @@ -1,158 +0,0 @@ -:: Licensed to the Apache Software Foundation (ASF) under one -:: or more contributor license agreements. See the NOTICE file -:: distributed with this work for additional information -:: regarding copyright ownership. The ASF licenses this file -:: to you under the Apache License, Version 2.0 (the -:: "License"); you may not use this file except in compliance -:: with the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, -:: software distributed under the License is distributed on an -:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -:: KIND, either express or implied. See the License for the -:: specific language governing permissions and limitations -:: under the License. - -@echo off -setlocal - -set "TYPE=%1" -if "%TYPE%"=="" exit /b 1 -for /f "tokens=1 delims=-" %%a in ("%TYPE%") do set "TYPE=%%a" - -if "%TYPE%"=="k3s" ( - set "K3S=true" -) else ( - set "K3S=false" -) - -if "%TYPE%"=="kind" ( - set "KIND=true" -) else ( - set "KIND=false" -) - -if "%TYPE%"=="mk8s" ( - set "MK8S=true" -) else ( - set "MK8S=false" -) - -if "%TYPE%"=="gke" ( - set "GKE=true" -) else ( - set "GKE=false" -) - -if "%TYPE%"=="aks" ( - set "AKS=true" -) else ( - set "AKS=false" -) - -if "%TYPE%"=="eks" ( - set "EKS=true" -) else ( - set "EKS=false" -) - -if not "%K3S%"=="true" ( - if not "%KIND%"=="true" ( - if not "%MK8S%"=="true" ( - if not "%GKE%"=="true" ( - if not "%AKS%"=="true" ( - if not "%EKS%"=="true" ( - echo "Error: input must be one of 'kind', 'k3s', 'mk8s', 'gke', 'aks', or 'eks'." - exit /b 1 - ) - ) - ) - ) - ) -) - -echo "##############################################" -echo "# #" -echo "# DEPLOYING %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp01-deploy.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING SSL %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp02-ssl.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING REDIS %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp03-sys-redis.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING FERRETDB (MONGO) %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp04a-sys-ferretdb.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING POSTGRES %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp04b-sys-postgres.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING MINIO %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp05-sys-minio.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING LOGIN %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp06-login.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING STATIC %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp07-static.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING USER REDIS %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp08-user-redis.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING USER FERRETDB (MONGO) %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp09a-user-ferretdb.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING USER POSTGRES %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp09b-user-postgres.cmd" %TYPE% - -echo "##############################################" -echo "# #" -echo "# TESTING USER MINIO %TYPE% #" -echo "# #" -echo "##############################################" -call "%~dp10-user-minio.cmd" %TYPE% \ No newline at end of file