Skip to content

Commit

Permalink
Add functionality for running against local CRC instances
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Jan 26, 2024
1 parent 8c87537 commit 974f7bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ export TNF_ENABLE_XML_CREATION=true

This will create a file named `cnf-certification-test/cnf-certification-tests_junit.xml`.


Check failure on line 110 in docs/configuration.md

View workflow job for this annotation

GitHub Actions / Run Linters and Vet

Multiple consecutive blank lines [Expected: 1; Actual: 2]
#### Enable running container against OpenShift Local

While running the test suite as a container, you can enable the container to be able to reach the local CRC instance by setting:

```shell
export TNF_ENABLE_CRC_TESTING=true
```

This utilizes the `--add-host` flag in Docker to be able to point `api.crc.testing` to the host gateway.

### Exceptions

These options allow adding exceptions to skip several checks for different resources. The exceptions must be justified in order to pass the CNF Certification.
Expand Down
5 changes: 5 additions & 0 deletions script/run-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ if [ -n "${DNS_ARG}" ]; then
DNS_ARG="--dns $DNS_ARG"
fi

if [ -n "${TNF_ENABLE_CRC_TESTING}" ]; then
ADD_HOST_ARG="--add-host api.crc.testing:host-gateway"
fi

set -x
# shellcheck disable=SC2068,SC2086 # Double quote array expansions.
${TNF_CONTAINER_CLIENT} run --rm $DNS_ARG \
Expand All @@ -168,6 +172,7 @@ ${TNF_CONTAINER_CLIENT} run --rm $DNS_ARG \
${container_tnf_dockercfg_volumes_cmd_args[@]} \
$CONFIG_VOLUME_MOUNT_ARG \
$TNF_OFFLINE_DB_MOUNT_ARG \
$ADD_HOST_ARG \
-v $OUTPUT_LOC:$CONTAINER_TNF_DIR/claim:Z \
-e KUBECONFIG=$CONTAINER_TNF_KUBECONFIG \
-e PFLT_DOCKERCONFIG=$CONTAINER_TNF_DOCKERCFG \
Expand Down

0 comments on commit 974f7bf

Please sign in to comment.