Skip to content

Commit d57a46e

Browse files
committed
1. Add test config for PC from secrets
2. Update docs
1 parent f597c92 commit d57a46e

File tree

3 files changed

+61
-20
lines changed

3 files changed

+61
-20
lines changed

.github/workflows/acceptance-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
export TESTARGS='-run="'$runFlag'"'
5454
echo "TESTARGS = $TESTARGS"
5555
echo '${{ secrets.FOUNDATION_CONFIG }}' > test_foundation_config.json
56+
echo '${{ secrets.PC_CONFIG }}' > test_config.json
5657
${{ secrets.ACCEPTANCE_TEST_ARGS }} make testacc
5758
- name: Code Coverage Check
5859
if: ${{ always() }}

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,46 @@ $ make cibuild
254254

255255
This command will create a `pkg/` directory with all the binaries for the most popular OS.
256256

257+
### Running tests of provider
258+
259+
For running unit tests:
260+
```sh
261+
make test
262+
```
263+
264+
For running integration tests:
265+
266+
1. Add environment variables for setup related details:
267+
```ssh
268+
export NUTANIX_USERNAME="<username>"
269+
export NUTANIX_PASSWORD="<password>"
270+
export NUTANIX_INSECURE=true
271+
export NUTANIX_PORT=9440
272+
export NUTANIX_ENDPOINT="<pc-ip>"
273+
export NUTANIX_STORAGE_CONTAINER="<storage-container-uuid-for-vm-tests>"
274+
export FOUNDATION_ENDPOINT="<foundation-vm-ip-for-foundation-related-tests>"
275+
export FOUNDATION_PORT=8000
276+
export NOS_IMAGE_TEST_URL="<test-image-url>"
277+
```
278+
279+
2. Some tests need setup related constants for resource creation. So add/replace details in test_config.json (for pc tests) and test_foundation_config.json (for foundation and foundation central tests)
280+
281+
3. To run all tests:
282+
```ssh
283+
make testacc
284+
```
285+
286+
4. To run specific tests:
287+
```ssh
288+
export TESTARGS='-run=TestAccNutanixPbr_WithSourceExternalDestinationNetwork'
289+
make testacc
290+
```
291+
292+
5. To run collection of tests:
293+
``` ssh
294+
export TESTARGS='-run=TestAccNutanixPbr*'
295+
make testacc
296+
```
257297

258298
### Common Issues using the development binary.
259299

test_config.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
{
2-
"subnet_name": "vlan.154",
3-
"default_container_name": "default-container-75702903530678",
2+
"subnet_name": "",
3+
"default_container_name": "",
44
"user_group_with_distinguished_name": {
5-
"distinguished_name": "cn=sspadmins,cn=users,dc=qa,dc=nucalm,dc=io",
6-
"display_name": "sspadmins",
7-
"uuid": "7fdb4b93-af49-4f3c-9422-d37c5b9b4dd8"
5+
"distinguished_name": "",
6+
"display_name": "",
7+
"uuid": ""
88
},
99
"permissions": [
1010
{
1111
"name": "",
12-
"uuid": "236a31e8-5762-4a3c-7b00-8c1753b898b5"
12+
"uuid": ""
1313
},
1414
{
15-
"name": "Delete_ACP",
16-
"uuid": "52176953-1b58-4e04-9238-1ae11ce8c620"
15+
"name": "",
16+
"uuid": ""
1717
}
1818
],
1919
"users": [
2020
{
21-
"principal_name": "user4@qa.nucalm.io",
22-
"expected_display_name": "user4",
23-
"directory_service_uuid": "fdba0891-13f1-473b-a92e-d0270095f689"
21+
"principal_name": "",
22+
"expected_display_name": "",
23+
"directory_service_uuid": ""
2424
},
2525
{
26-
"principal_name": "user6@qa.nucalm.io",
27-
"expected_display_name": "user6",
28-
"directory_service_uuid": "fdba0891-13f1-473b-a92e-d0270095f689"
26+
"principal_name": "",
27+
"expected_display_name": "",
28+
"directory_service_uuid": ""
2929
},
3030
{
31-
"principal_name": "ssptest3@qa.nucalm.io",
32-
"expected_display_name": "ssptest3",
33-
"directory_service_uuid": "fdba0891-13f1-473b-a92e-d0270095f689"
31+
"principal_name": "",
32+
"expected_display_name": "",
33+
"directory_service_uuid": ""
3434
}
3535
],
36-
"node_os_version": "ntnx-1.0",
36+
"node_os_version": "",
3737
"ad_rule_target": {
38-
"name": "ADGroup",
39-
"values": "sspadmins"
38+
"name": "",
39+
"values": ""
4040
}
4141
}
4242

0 commit comments

Comments
 (0)