Skip to content

Commit

Permalink
added bash script for running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu219 committed Jan 1, 2025
1 parent 2615906 commit a0a0293
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 17 deletions.
17 changes: 9 additions & 8 deletions AppendBlobReader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ This command copies required files in `AppendBlobReader/target` directory

Integrations tests are in `AppendBlobReader/tests` folder and unit tests are in sumo-`function-utils/tests` folder

Modify the run_integration_test.sh file with below parameters
```console

export AZURE_SUBSCRIPTION_ID=`<Your azure subscription id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-azure-subscription>`
export AZURE_CLIENT_ID=`Your application id which you can get after registering application. Refer https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application`
export AZURE_CLIENT_SECRET=`Generate client secret by referring docs https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-credentials`
export AZURE_TENANT_ID=`You tenant id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant`
export AZURE_DEFAULT_REGION=`eastus`
export SUMO_ACCESS_ID=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
export SUMO_ACCESS_KEY=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
export SUMO_DEPLOYMENT=`Enter one of the allowed values au, ca, de, eu, fed, in, jp, us1 or us2. Visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security`
AZURE_SUBSCRIPTION_ID=`<Your azure subscription id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-azure-subscription>`
AZURE_CLIENT_ID=`Your application id which you can get after registering application. Refer https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application`
AZURE_CLIENT_SECRET=`Generate client secret by referring docs https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-credentials`
AZURE_TENANT_ID=`You tenant id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant`
AZURE_DEFAULT_REGION=`eastus`
SUMO_ACCESS_ID=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
SUMO_ACCESS_KEY=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
SUMO_DEPLOYMENT=`Enter one of the allowed values au, ca, de, eu, fed, in, jp, us1 or us2. Visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security`
```

Execute below command under `AppendBlobReader/tests` directory
Expand Down
15 changes: 15 additions & 0 deletions AppendBlobReader/tests/run_integration_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

export AZURE_SUBSCRIPTION_ID=""
# application id
export AZURE_CLIENT_ID=""
export AZURE_CLIENT_SECRET=""
export AZURE_TENANT_ID=""
export AZURE_DEFAULT_REGION="eastus"
export SUMO_ACCESS_ID=""
export SUMO_ACCESS_KEY=""
export SUMO_DEPLOYMENT="us1"
export TEMPLATE_NAME="appendblobreaderdeploy.json"
python test_appendblobreader.py
# For deleting leftover resources in case of failures
# python ~/git/sumologic-azure-function/deletetestresourcegroups.py
20 changes: 11 additions & 9 deletions BlockBlobReader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ Integrations tests are in `BlockBlobReader/tests` folder and unit tests are in `

Integrations tests are in `BlockBlobReader/tests` folder and unit tests are in sumo-`function-utils/tests` folder

```console
Modify the run_integration_test.sh file with below parameters

export AZURE_SUBSCRIPTION_ID=`<Your azure subscription id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-azure-subscription>`
export AZURE_CLIENT_ID=`Your application id which you can get after registering application. Refer https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application`
export AZURE_CLIENT_SECRET=`Generate client secret by referring docs https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-credentials`
export AZURE_TENANT_ID=`You tenant id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant`
export AZURE_DEFAULT_REGION=`eastus`
export SUMO_ACCESS_ID=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
export SUMO_ACCESS_KEY=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
export SUMO_DEPLOYMENT=`Enter one of the allowed values au, ca, de, eu, fed, in, jp, us1 or us2. Visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security`
```console

AZURE_SUBSCRIPTION_ID=`<Your azure subscription id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-azure-subscription>`
AZURE_CLIENT_ID=`Your application id which you can get after registering application. Refer https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application`
AZURE_CLIENT_SECRET=`Generate client secret by referring docs https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-credentials`
AZURE_TENANT_ID=`You tenant id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant`
AZURE_DEFAULT_REGION=`eastus`
SUMO_ACCESS_ID=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
SUMO_ACCESS_KEY=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
SUMO_DEPLOYMENT=`Enter one of the allowed values au, ca, de, eu, fed, in, jp, us1 or us2. Visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security`
```


Execute below command under `BlockBlobReader/tests` directory

`python test_blobreader.py`
Expand Down
21 changes: 21 additions & 0 deletions BlockBlobReader/tests/run_integration_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export AZURE_SUBSCRIPTION_ID=""
# application id
export AZURE_CLIENT_ID=""
export AZURE_CLIENT_SECRET=""
export AZURE_TENANT_ID=""
export AZURE_DEFAULT_REGION="eastus"
export SUMO_ACCESS_ID=""
export SUMO_ACCESS_KEY=""
export SUMO_DEPLOYMENT="us1"
export TEMPLATE_NAME="blobreaderdeploy.json"
# export FIXTURE_FILE="blob_fixtures.json"
export FIXTURE_FILE="blob_fixtures_vnetflowlogs.json"
# export FIXTURE_FILE="blob_fixtures_subnetflowlogs.json"
# export FIXTURE_FILE="blob_fixtures_networkinterfaceflowlogs.json"
export MAX_FOLDER_DEPTH=1
# export TEMPLATE_NAME="blobreaderdeploywithPremiumPlan.json"
# export TEMPLATE_NAME="blobreaderzipdeploy.json"
python test_blobreader.py
# python ~/git/sumologic-azure-function/deletetestresourcegroups.py
12 changes: 12 additions & 0 deletions EventHubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ This command copies required files in two directories logs_build(used for activi

Integrations tests are in EventHubs/tests folder and unit tests are in sumo-function-utils/tests folder

Modify the run_integration_test.sh file with below parameters
```console

AZURE_SUBSCRIPTION_ID=`<Your azure subscription id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-azure-subscription>`
AZURE_CLIENT_ID=`Your application id which you can get after registering application. Refer https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application`
AZURE_CLIENT_SECRET=`Generate client secret by referring docs https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-credentials`
AZURE_TENANT_ID=`You tenant id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant`
AZURE_DEFAULT_REGION=`eastus`
SUMO_ACCESS_ID=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
SUMO_ACCESS_KEY=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
SUMO_DEPLOYMENT=`Enter one of the allowed values au, ca, de, eu, fed, in, jp, us1 or us2. Visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security`
```
15 changes: 15 additions & 0 deletions EventHubs/tests/run_integration_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

export AZURE_SUBSCRIPTION_ID=""
# application id
export AZURE_CLIENT_ID=""
export AZURE_CLIENT_SECRET=""
export AZURE_TENANT_ID=""
export AZURE_DEFAULT_REGION="eastus"
export SUMO_ACCESS_ID=""
export SUMO_ACCESS_KEY=""
export SUMO_DEPLOYMENT="us1"
export TEMPLATE_NAME="azuredeploy_metrics.json"
python test_eventhub_metrics.py
# For deleting leftover resources in case of failures
# python ~/git/sumologic-azure-function/deletetestresourcegroups.py

0 comments on commit a0a0293

Please sign in to comment.