Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USHIFT-1102: add static manifest details for running openshift-tests #1969

Merged
merged 1 commit into from Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/multinode/setup.md
Expand Up @@ -75,3 +75,5 @@ watch oc get pods -A
```

Run your test suite of choice using the primary and secondary MicroShift instances.

If you want to run [openshift-tests](https://github.com/openshift/origin) suite, follow [this](../openshift_ci.md#running-tests-manually) document.
46 changes: 45 additions & 1 deletion docs/openshift_ci.md
Expand Up @@ -12,7 +12,51 @@ Prior to opening a PR it is useful and efficient to be able to run tests locally

`openshift-tests` requires a kubeconfig and `oc` binary as well. MicroShift generates a kubeconfig located in `/var/lib/microshift/resources/kubeadmin/kubeconfig`, but we will see how to use it depending on local vs remote access to MicroShift instances.

Once we have the kubeconfig working, we can launch the tests. In order to run `openshift-tests` for `MicroShift` we need to provide KUBECONFIG and one specific option:
Once we have the kubeconfig working, we need to set the static manifests pointed through `STATIC_CONFIG_MANIFEST_DIR` environment variable.

```sh
mkdir ~/manifests
export STATIC_CONFIG_MANIFEST_DIR=~/manifests
```

Currently only manifests from `[infrastructure|network].config.openshift.io/v1` are supported as static manifests.

```sh
MICROSHIFT_URL="<microshift-server-url>"
cat > ${STATIC_CONFIG_MANIFEST_DIR}/infrastructure.yaml <<EOF
apiVersion: "config.openshift.io/v1"
kind: Infrastructure
metadata:
name: cluster
spec:
platformSpec:
type: None
status:
apiServerURL: ${MICROSHIFT_URL}
controlPlaneTopology: SingleReplica
infrastructureTopology: SingleReplica
platform: None
platformStatus:
type: None
EOF
cat > ${STATIC_CONFIG_MANIFEST_DIR}/network.yaml <<EOF
apiVersion: config.openshift.io/v1
kind: Network
metadata:
name: cluster
spec:
networkType: OVNKubernetes
status:
networkType: OVNKubernetes
EOF
```

> Update `<microshift-server-url>` with the accessible MicroShift server url.


After storing these manifests into `~/manifests` directory, we can launch the tests.

In order to run `openshift-tests` for `MicroShift` we need to provide KUBECONFIG and one specific option:
```
KUBECONFIG=~/.kube/microshift ./openshift-tests --provider none -v 2 <test suite name> -o <output file name> --junit-dir <junit dir path>
```
Expand Down