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

Minor fixes to testing readme files #69

Merged
merged 3 commits into from
Jun 20, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,44 @@ Before running E2E tests ensure that you have all the required components locall
1. Build NRI resource policy static binaries. You need to be at the root of the NRI-resource-policy directory.

```shell
$ make build
make build
```

2. Build the container image. You need to be at the root of the NRI-resource-policy directory.

```shell
$ make images
make images
```

3. Build containerd binaries that include NRI support (minimum tag version [`containerd 1.7.0-beta.1`](https://github.com/containerd/containerd/releases/tag/v1.7.0-beta.1) or +)

```shell
$ git clone https://github.com/containerd/containerd.git
$ cd containerd
$ make build
git clone https://github.com/containerd/containerd.git
cd containerd
make
```

4. Then run the tests.

```shell
$ cd test/e2e
$ ./run_tests.sh policies.test-suite
cd test/e2e
./run_tests.sh policies.test-suite
```

The default test output directory name is generated from the used topology
and runtime name and the directory is created under test/e2e.
The test output directory can be given as a 2nd paramter to the script.

```shell
$ ./run_tests.sh policies.test-suite ~/output-directory
./run_tests.sh policies.test-suite ~/output-directory
```

Note that Vagrant VM is stored into the output directory. If you want to
remove the output directory, then please remove the Vagrant VM first like
this:

```shell
$ cd ~/output-directory && vagrant destroy -f
cd ~/output-directory && vagrant destroy -f
```

The e2e test runs can be can be configured by setting various options as
Expand All @@ -66,21 +66,22 @@ Before running E2E tests ensure that you have all the required components locall
For example:

```shell
$ https_proxy=http://proxy.example.com dns_nameserver=8.8.8.8 dns_search_domain=example.com ./run_tests.sh policies.test-suite
https_proxy=http://proxy.example.com dns_nameserver=8.8.8.8 dns_search_domain=example.com ./run_tests.sh policies.test-suite
```

5. You can login to the e2e test VM:

```shell
$ cd ~/output-directory
$ make ssh
cd ~/output-directory
make ssh
```

6. While the e2e tests are running, you can monitor the status of the tests:

```shell
$ cd ~/output-directory
$ <nri-plugins-root-directory>/test/e2e/report-test-status.sh
cd ~/output-directory
<nri-plugins-root-directory>/test/e2e/report-test-status.sh

policies.test-suite balloons test01-basic-placement : PASS
policies.test-suite balloons test02-prometheus-metrics : PASS
policies.test-suite balloons test03-reserved : PASS
Expand Down
40 changes: 21 additions & 19 deletions test/self-hosted-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Github self hosted action runner setup
This package describes how to setup Github action-runner [[1]](#s1) to run in
self hosted environment [[2]](#s2).

The setup is devided into two parts, in step 1) a generic Ubuntu 22.04 image
is used as a base and new software like Go compiler etc. is installed into it.
The setup is divided into two parts, in step 1) a generic Ubuntu 22.04 image
is used as a base and new software like Go compiler etc. is installed to it.
Then in step 2) this base image is used to run the actual e2e tests in it.
A freshly installed Ubuntu image is used for each e2e test run.

Expand All @@ -21,9 +21,9 @@ There are several layer of VMs and host OS here:
directory.

* The actual e2e tests are run inside a Vagrant created VM inside the Docker
container. The the e2e scripts use ansible tool to install the actual VM
image used in the testing. The desired e2e OS is selected by the github
workflow file and is not selected by the action runner scripts.
container. The e2e scripts use Ansible tool to install the actual VM
image used in testing. The desired e2e OS is selected by the github
workflow file and not by the action runner scripts.

Note that the self hosted runner needs to be configured in Github side first.
You need to create a Github App that is able to create runner registration
Expand All @@ -37,10 +37,10 @@ registration token using an App:

* Create a private key file (PEM) for that and download it. [[4]](#s4)

* Install the Github App onto your account and desired repository.
* Install the Github App onto your account and desired repository. [[5]](#s5)

This will allow the `runner.sh` script to create an access token which can
then create the self-hosted registration token needed to run the e2e tests.
This will allow the `runner.sh` script to create an access token which is then
used to create the self-hosted registration token needed to run the e2e tests.

Details
-------
Expand All @@ -50,23 +50,23 @@ Docker.

For Fedora, this means you need to install these packages to your host:

```
$ sudo dnf install docker make
```shell
sudo dnf install docker make
```

For Ubuntu, you need to install these packages to your host:

```
$ sudo apt install make
$ sudo sh -c "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
$ sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null'
$ sudo sh -c "apt-get update -y && apt-get install -y docker-ce docker-ce-cli containerd.io"
```shell
sudo apt install make
sudo sh -c "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null'
sudo sh -c "apt-get update -y && apt-get install -y docker-ce docker-ce-cli containerd.io"
```

Create a configuration file for the runner:

```
$ make create-env
```shell
make create-env
```

Edit the generated env file, and add relevant parameters from github action
Expand All @@ -77,8 +77,8 @@ Final step is to configure and run the self-hosted action runner.
Note that at this point, the runner will contact github so the Github
configuration settings in the env configuration file needs to be set properly.

```
$ make run
```shell
make run
```

The `make run` will launch `runner.sh` which will create the runner container
Expand All @@ -98,3 +98,5 @@ to be ready to serve new job requests.
[3]<a name="s3"></a> https://docs.github.com/en/developers/apps/building-github-apps/creating-a-github-app

[4]<a name="s4"></a> https://docs.github.com/en/developers/apps/authenticating-with-github-apps#generating-a-private-key

[5]<a name="s5"></a> https://docs.github.com/en/apps/using-github-apps/installing-your-own-github-app
2 changes: 1 addition & 1 deletion test/statistics-analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ EOF
systemctl restart crio
```

See also https://github.com/cri-o/cri-o/blob/main/docs/crio.conf.5.md#criotracing-table
See also [`crio tracing`](https://github.com/cri-o/cri-o/blob/main/docs/crio.conf.5.md#criotracing-table) for more details.