-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ MOSIP-26249 ] Added and updated scripts for DSLRIG and apitestrig (#…
…1260) * [ MOSIP-26249 ] Added and updated scripts for DSLRIG and apitestrig * AUTHDEMO * PACKETCREATOR * APITESTRIG * DSLRIG * [ MOSIP-26249 ] added image for dslrig * AUTHDEMO * PACKETCREATOR * APITESTRIG * DSLRIG --------- Co-authored-by: syed-salman-technoforte <[email protected]>
- Loading branch information
1 parent
d68d8be
commit 1e85f01
Showing
29 changed files
with
688 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# TESTRIG | ||
|
||
## Overview | ||
The steps here install Testrig components, which include APITESTRIG and DSLRIG. | ||
These components are used to test the working of APIs of MOSIP modules and the end-to-end functional flows involving multiple MOSIP modules. | ||
|
||
## APITESTRIG Install | ||
Install in the following order: | ||
* [Authdemo](authdemo/README.md) | ||
* [Apitestrig](apitestrig/README.md) | ||
|
||
## DSLRIG Install | ||
Install in the following order: | ||
* [Packetcreator](packetcreator/README.md) | ||
* [Authdemo](authdemo/README.md) | ||
* [DSLRIG](dslrig/README.md) | ||
|
||
## Delete | ||
* Follow the steps mentioned in the below links to uninstall DSLRIG. | ||
* [DSLRIG](dslrig/README.md#uninstall) | ||
* [Authdemo](authdemo/README.md#uninstall) | ||
* [Packetcreator](packetcreator/README.md#uninstall) | ||
* Follow the steps mentioned in the below links to uninstall ApiTestrig. | ||
* [Authdemo](authdemo/README.md#uninstall) | ||
* [Apitestrig](apitestrig/README.md#uninstall) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hosts.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Authdemo | ||
|
||
## Introduction | ||
Authdemo is used to execute IDA APIs used by Apitestrig & DSLrig. | ||
|
||
## Install | ||
* Install | ||
```sh | ||
./install.sh | ||
``` | ||
|
||
## Uninstall | ||
* To uninstall Authdemo, run `delete.sh` script. | ||
```sh | ||
./delete.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# Copy configmaps from other namespaces | ||
# DST_NS: Destination namespace | ||
COPY_UTIL=../../utils/copy_cm_func.sh | ||
DST_NS=authdemo | ||
$COPY_UTIL configmap config-server-share config-server $DST_NS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# Copy secrets from other namespaces | ||
# DST_NS: Destination namespace | ||
COPY_UTIL=../../utils/copy_cm_func.sh | ||
DST_NS=authdemo | ||
$COPY_UTIL secret keycloak-client-secrets keycloak $DST_NS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# Uninstalls authdemo | ||
## Usage: ./delete.sh [kubeconfig] | ||
|
||
if [ $# -ge 1 ] ; then | ||
export KUBECONFIG=$1 | ||
fi | ||
|
||
function deleting_authdemo() { | ||
NS=authdemo | ||
while true; do | ||
read -p "Are you sure you want to delete authdemo helm charts?(Y/n) " yn | ||
if [ $yn = "Y" ] | ||
then | ||
helm -n $NS delete authdemo | ||
break | ||
else | ||
break | ||
fi | ||
done | ||
return 0 | ||
} | ||
|
||
# set commands for error handling. | ||
set -e | ||
set -o errexit ## set -e : exit the script if any statement returns a non-true return value | ||
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable | ||
set -o errtrace # trace ERR through 'time command' and other functions | ||
set -o pipefail # trace ERR through pipes | ||
deleting_authdemo # calling function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
# Installs authdemo | ||
## Usage: ./install.sh [kubeconfig] | ||
|
||
if [ $# -ge 1 ] ; then | ||
export KUBECONFIG=$1 | ||
fi | ||
|
||
NS=authdemo | ||
CHART_VERSION=12.0.1-B3 | ||
|
||
echo Create $NS namespace | ||
kubectl create ns $NS | ||
|
||
|
||
function installing_authdemo() { | ||
echo Istio label | ||
kubectl label ns $NS istio-injection=enabled --overwrite | ||
helm repo update | ||
|
||
echo Copy configmaps | ||
./copy_cm.sh | ||
|
||
echo Copy secrets | ||
./copy_secrets.sh | ||
|
||
echo "Do you have public domain & valid SSL? (Y/n) " | ||
echo "Y: if you have public domain & valid ssl certificate" | ||
echo "n: if you don't have public domain & valid ssl certificate" | ||
read -p "" flag | ||
|
||
if [ -z "$flag" ]; then | ||
echo "'flag' was provided; EXITING;" | ||
exit 1; | ||
fi | ||
ENABLE_INSECURE='' | ||
if [ "$flag" = "n" ]; then | ||
ENABLE_INSECURE='--set authdemo.configmaps.authdemo.ENABLE_INSECURE=true'; | ||
fi | ||
|
||
read -p "Please provide NFS host : " NFS_HOST | ||
read -p "Please provide NFS pem file for SSH login : " NFS_PEM_FILE | ||
read -p "Please provide user for SSH login : " NFS_USER | ||
echo -e "[nfs_server]\nnfsserver ansible_user=$NFS_USER ansible_host=$NFS_HOST ansible_ssh_private_key_file=$NFS_PEM_FILE" > hosts.ini | ||
ansible-playbook -i hosts.ini nfs-server.yaml | ||
|
||
|
||
echo Installing authdemo | ||
helm -n $NS install authdemo mosip/authdemo $ENABLE_INSECURE \ | ||
--set persistence.nfs.server="$NFS_HOST" \ | ||
--version $CHART_VERSION --wait | ||
|
||
echo Installed authdemo. | ||
return 0 | ||
} | ||
|
||
# set commands for error handling. | ||
set -e | ||
set -o errexit ## set -e : exit the script if any statement returns a non-true return value | ||
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable | ||
set -o errtrace # trace ERR through 'time command' and other functions | ||
set -o pipefail # trace ERR through pipes | ||
installing_authdemo # calling function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
- name: Install NFS server setup for authdemo | ||
hosts: "nfs_server" | ||
become: yes | ||
become_method: sudo | ||
vars: | ||
nfs_directories: | ||
- name: /srv/nfs/mosip/packetcreator-authdemo-authcerts | ||
nfs_exports: | ||
"*(rw,sync,no_root_squash,no_all_squash,insecure,subtree_check)" | ||
|
||
tasks: | ||
- name: Install NFS server | ||
apt: | ||
name: nfs-kernel-server | ||
state: present | ||
|
||
- name: Enable necessary TCP ports for NFS | ||
ufw: | ||
rule: allow | ||
port: "{{ item }}" | ||
proto: tcp | ||
state: enabled | ||
with_items: | ||
- '111' | ||
- '2049' | ||
|
||
- name: Enable necessary UDP ports for NFS | ||
ufw: | ||
rule: allow | ||
port: "{{ item }}" | ||
proto: udp | ||
state: enabled | ||
with_items: | ||
- '111' | ||
- '2049' | ||
|
||
- name: Enable nfs server | ||
command: 'systemctl enable nfs-server' | ||
|
||
- name: Start nfs server | ||
command: 'systemctl start nfs-server' | ||
|
||
- name: Add user mosip | ||
user: | ||
name: mosip | ||
|
||
- name: Create nfs mount folder | ||
file: | ||
path: '{{ item.name }}' | ||
state: directory | ||
owner: mosip | ||
group: mosip | ||
with_items: "{{ nfs_directories }}" | ||
|
||
- name: Export NFS directories | ||
lineinfile: | ||
path: /etc/exports | ||
line: "{{ item.name }} {{ nfs_exports }}" | ||
state: present | ||
with_items: "{{ nfs_directories }}" | ||
|
||
- name: exportfs | ||
command: 'exportfs -rav' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hosts.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# DSLRIG | ||
|
||
## Introduction | ||
DSLRIG will test end-to-end functional flows involving multiple MOSIP modules. | ||
|
||
## Prerequisites | ||
* Packet utility running in rancher cluster exposed to be accessed by the cluster. | ||
* Auth demo and DSLRIG to be running in the same cluster. | ||
* NFS server already present and related details. | ||
|
||
## Install | ||
* Install | ||
```sh | ||
./install.sh | ||
``` | ||
|
||
## Uninstall | ||
* To uninstall DSLRIG, run `delete.sh` script. | ||
```sh | ||
./delete.sh | ||
``` | ||
|
||
## Run dslrig manually | ||
|
||
#### Rancher UI | ||
* Run dslrig manually via Rancher UI. | ||
![dslrig-1.png](../../docs/images/dslrig-1.png) | ||
* There are two modes of dslrig `sanity` & `full`. | ||
* By default, dslrig will execute in `full` mode. | ||
* If you want to run dslrig with `sanity` mode, | ||
Update the `TESTLEVEL` key in the `dslorchestrator` configmap and rerun the dslrig job. | ||
|
||
#### CLI | ||
* Download Kubernetes cluster `kubeconfig` file from `rancher dashboard` to your local. | ||
![apitestrig-1.png](../../docs/images/apitestrig-1.png) | ||
* Install `kubectl` package to your local machine. | ||
* Run dslrig manually via CLI by creating a new job from an existing k8s cronjob. | ||
``` | ||
kubectl --kubeconfig=<k8s-config-file> -n dslrig create job --from=cronjob/<cronjob-name> <job-name> | ||
``` | ||
example: | ||
``` | ||
kubectl --kubeconfig=/home/xxx/Downloads/qa4.config -n dslrig create job --from=cronjob/cronjob-dslorchestrator cronjob-dslorchestrator | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# Copy configmaps from other namespaces | ||
# DST_NS: Destination namespace | ||
COPY_UTIL=../../utils/copy_cm_func.sh | ||
DST_NS=dslrig | ||
$COPY_UTIL configmap global default $DST_NS | ||
$COPY_UTIL configmap keycloak-host keycloak $DST_NS | ||
$COPY_UTIL configmap artifactory-share artifactory $DST_NS | ||
$COPY_UTIL configmap config-server-share config-server $DST_NS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# Copy secrets from other namespaces | ||
# DST_NS: Destination namespace | ||
COPY_UTIL=../../utils/copy_cm_func.sh | ||
DST_NS=dslrig | ||
$COPY_UTIL secret keycloak-client-secrets keycloak $DST_NS | ||
$COPY_UTIL secret s3 s3 $DST_NS | ||
$COPY_UTIL secret postgres-postgresql postgres $DST_NS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# Uninstalls dslrig | ||
## Usage: ./delete.sh [kubeconfig] | ||
|
||
if [ $# -ge 1 ] ; then | ||
export KUBECONFIG=$1 | ||
fi | ||
|
||
function deleting_dslrig() { | ||
NS=dslrig | ||
while true; do | ||
read -p "Are you sure you want to delete dslrig helm charts?(Y/n) " yn | ||
if [ $yn = "Y" ] | ||
then | ||
helm -n $NS delete dslorchestrator | ||
break | ||
else | ||
break | ||
fi | ||
done | ||
return 0 | ||
} | ||
|
||
# set commands for error handling. | ||
set -e | ||
set -o errexit ## set -e : exit the script if any statement returns a non-true return value | ||
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable | ||
set -o errtrace # trace ERR through 'time command' and other functions | ||
set -o pipefail # trace ERR through pipes | ||
deleting_dslrig # calling function |
Oops, something went wrong.