Skip to content

Commit a297a8e

Browse files
authored
Add linter for Markdown (#254)
1 parent 8a81195 commit a297a8e

File tree

3 files changed

+53
-22
lines changed

3 files changed

+53
-22
lines changed

.github/workflows/pre-main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
with:
3434
dockerfile: "Dockerfile*"
3535
recursive: true
36+
- uses: nosborn/[email protected]
37+
with:
38+
files: .
3639
- uses: ludeeus/action-shellcheck@master
3740
env:
3841
SHELLCHECK_OPTS: --external-sources

README.md

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# CNF Certification Partner [![license](https://img.shields.io/github/license/test-network-function/cnf-certification-test-partner?color=blue&labelColor=gray&logo=apache&logoColor=lightgray&style=flat)](https://github.com/test-network-function/cnf-certification-test-partner/blob/master/LICENSE)
1+
<!-- markdownlint-disable line-length no-bare-urls -->
2+
# CNF Certification Partner
3+
4+
[![tests](https://github.com/test-network-function/cnf-certification-test-partner/actions/workflows/pre-main.yml/badge.svg)](https://github.com/test-network-function/cnf-certification-test-partner/actions/workflows/pre-main.yml)
5+
[![red hat](https://img.shields.io/badge/red%20hat---?color=gray&logo=redhat&logoColor=red&style=flat)](https://www.redhat.com)
6+
[![openshift](https://img.shields.io/badge/openshift---?color=gray&logo=redhatopenshift&logoColor=red&style=flat)](https://www.redhat.com/en/technologies/cloud-computing/openshift)
7+
[![license](https://img.shields.io/github/license/test-network-function/cnf-certification-test-partner?color=blue&labelColor=gray&logo=apache&logoColor=lightgray&style=flat)](https://github.com/test-network-function/cnf-certification-test-partner/blob/master/LICENSE)
28

39
This repository contains two main sections:
10+
411
* test-partner: Partner debug pods definition for use on a k8s CNF Certification cluster. Used to run platform and networking tests.
512
* test-target: A trivial example CNF (including a replicaset/deployment, a CRD and an operator), primarily intended to be used to run [test-network-function](https://github.com/test-network-function/test-network-function) test suites on a development machine.
613

@@ -24,17 +31,21 @@ export TNF_EXAMPLE_CNF_NAMESPACE="tnf" #tnf for example
2431
```
2532

2633
## On-demand vs always on debug pods
34+
2735
By default debug pods are installed on demand when the tnf test suite is deployed. To deploy debug pods on all nodes in the cluster, configure the following environment variable:
36+
2837
```shell-script
2938
export ON_DEMAND_DEBUG_PODS=false
3039
```
40+
3141
## Cloning the repository
3242

3343
The repository can be cloned to local machine using:
3444

3545
```shell-script
3646
git clone [email protected]:test-network-function/cnf-certification-test-partner.git
3747
```
48+
3849
# Installing the partner pod
3950

4051
In order to create and deploy the partner debug pods (daemonset), use the following:
@@ -43,21 +54,21 @@ In order to create and deploy the partner debug pods (daemonset), use the follow
4354
make install-partner-pods
4455
```
4556

46-
This will create a deployment named "partner" in the "default" namespace. This Pod is the test partner for running CNF tests.
57+
This will create a deployment named "partner" in the "default" namespace. This Pod is the test partner for running CNF tests.
4758
For disconnected environments, override the default image repo `quay.io/testnetworkfunction` by setting the environment variable named `TNF_PARTNER_REPO` to the local repo.
4859
For environments with slow internet connection, override the default deployment timeout value (120s) by setting the environment variable named `TNF_DEPLOYMENT_TIMEOUT`.
4960

5061
# Installing the Test-target
5162

5263
Although any CNF Certification results should be generated using a proper CNF Certification cluster, there are times
53-
in which using a local emulator can greatly help with test development. As such, [test-target](./test-target)
54-
provides a very simple PUT, OT, CRD, which satisfies the minimal requirements to perform test cases.
64+
in which using a local emulator can greatly help with test development. As such, [test-target](./test-target)
65+
provides a simple PUT, OT, CRD, which satisfies the minimal requirements to perform test cases.
5566
These can be used in conjunction with a local [kind](https://kind.sigs.k8s.io/) cluster to perform local test development.
5667

57-
5868
## Dependencies
5969

6070
In order to run the local test setup, the following dependencies are needed:
71+
6172
* [vagrant](https://www.vagrantup.com/downloads)
6273
* [kind](https://kind.sigs.k8s.io/)
6374
* [Docker](https://docs.docker.com/get-docker/)
@@ -67,6 +78,7 @@ In order to run the local test setup, the following dependencies are needed:
6778
## Setup with docker and kind
6879

6980
Install the latest docker version ( https://docs.docker.com/engine/install/fedora ):
81+
7082
```shell-script
7183
sudo dnf config-manager \
7284
--add-repo \
@@ -88,7 +100,8 @@ sudo dnf -y install dnf-plugins-core
88100
sudo dnf install docker-ce docker-ce-cli containerd.io
89101
```
90102

91-
Perform the post install ( https://docs.docker.com/engine/install/linux-postinstall )
103+
Perform the post install ( https://docs.docker.com/engine/install/linux-postinstall ):
104+
92105
```shell-script
93106
sudo systemctl start docker.service
94107
sudo systemctl enable docker.service
@@ -97,7 +110,9 @@ Perform the post install ( https://docs.docker.com/engine/install/linux-postinst
97110
sudo usermod -aG docker $USER
98111
newgrp docker
99112
```
100-
Configure IPv6 in docker ( https://docs.docker.com/config/daemon/ipv6/ )
113+
114+
Configure IPv6 in docker ( https://docs.docker.com/config/daemon/ipv6/ ):
115+
101116
```shell-script
102117
# update docker config
103118
sudo bash -c 'cat <<- EOF > /etc/docker/daemon.json
@@ -109,37 +124,43 @@ EOF'
109124
```
110125

111126
Enable IPv6 with:
127+
112128
```shell-script
113129
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
114130
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0
115131
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
116132
```
117133

118134
to persist IPv6 support, edit or add the following lines in the /etc/sysctl.conf file
135+
119136
```shell-script
120137
net.ipv6.conf.all.disable_ipv6 = 0
121138
net.ipv6.conf.default.disable_ipv6 = 0
122139
net.ipv6.conf.lo.disable_ipv6 = 0
123140
```
124141

125-
disable firewall, if present, as multus interfaces will not be able to communicate.
142+
disable firewall, if present, as multus interfaces will not be able to communicate.
143+
144+
Note: if docker is already running after running the command below, also restart docker as taking the firewall down will remove the docker rules:
126145

127-
Note: if docker is already running after running the command below, also restart docker as taking the firewall down will remove the docker rules
128146
```shell-script
129147
sudo systemctl stop firewalld
130148
```
131149

132-
restart docker
150+
restart docker:
151+
133152
```shell-script
134153
sudo systemctl restart docker
135154
```
136155

137156
Download and install Kubernetes In Docker (Kind):
157+
138158
```shell-script
139159
curl -Lo kind https://github.com/kubernetes-sigs/kind/releases/download/v0.18.0/kind-linux-amd64
140160
```
141161

142-
Configure a cluster with 4 worker nodes and one master node ( dual stack ):
162+
Configure a cluster with 4 worker nodes and one master node ( dual stack ):
163+
143164
```shell-script
144165
cat <<- EOF > config.yaml
145166
kind: Cluster
@@ -155,19 +176,22 @@ EOF
155176
kind create cluster --config=config.yaml
156177
```
157178

158-
Increase max files limit to prevent issue due to the large cluster size ( see https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files )
179+
Increase max files limit to prevent issue due to the large cluster size ( see https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files ):
180+
159181
```shell-script
160182
sudo sysctl fs.inotify.max_user_watches=524288
161183
sudo sysctl fs.inotify.max_user_instances=512
162184
```
185+
163186
To make the changes persistent, edit the file /etc/sysctl.conf and add these lines:
187+
164188
```shell-script
165189
fs.inotify.max_user_watches = 524288
166190
fs.inotify.max_user_instances = 512
167-
168191
fs.inotify.max_user_watches = 524288
169192
fs.inotify.max_user_instances = 512
170193
```
194+
171195
### Deploy both test target and test partner as a local-test-infra
172196

173197
To create the resources, issue the following command:
@@ -182,13 +206,14 @@ will use this local infrastructure by default.
182206

183207
Note that this command also creates OT and CRD resources.
184208

185-
To verify `test` pods are running:
209+
To verify `test` pods are running:
186210

187211
```shell-script
188212
oc get pods -n $TNF_EXAMPLE_CNF_NAMESPACE -o wide
189213
```
190214

191215
You should see something like this (note that the 2 test pods are running on different nodes due to a anti-affinity rule):
216+
192217
```shell-script
193218
$ oc get pods -ntnf -owide
194219
NAME READY STATUS RESTARTS AGE
@@ -199,6 +224,7 @@ test-66f77bd94-2w4l8 1/1 Running 0
199224
test-66f77bd94-6kd6j 1/1 Running 0 85m
200225

201226
```
227+
202228
### Delete local-test-infra
203229

204230
To tear down the local test infrastructure from the cluster, use the following command. It may take some time to completely stop the PUT, CRD, OT, and DP:
@@ -209,7 +235,8 @@ make clean
209235

210236
## Setup with Vagrant, docker and kind (Mac OS support)
211237

212-
Install vagrant for your platform
238+
Install vagrant for your platform:
239+
213240
```shell-script
214241
https://www.vagrantup.com/downloads
215242
```
@@ -222,6 +249,7 @@ make vagrant-build
222249

223250
The kubeconfig for the new environment will override the file located at ~/.kube/config
224251
Just start running commands from the command line to test the new cluster:
252+
225253
```shell-script
226254
oc get pods -A
227255
```
@@ -233,14 +261,17 @@ make vagrant-destroy
233261
```
234262

235263
To access the virtual machine supporting the cluster, do the following:
264+
236265
```shell-script
237266
cd config/vagrant
238267
user@fedora vagrant]$ vagrant ssh
239268
[vagrant@k8shost ~]$
240269
```
270+
241271
The partner repo scripts are located in ~/partner
242272

243273
## License
274+
244275
CNF Certification Test Partner is copyright [Red Hat, Inc.](https://www.redhat.com) and available
245276
under an
246277
[Apache 2 license](https://github.com/test-network-function/cnf-certification-test-partner/blob/main/LICENSE).

examples/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- markdownlint-disable line-length no-bare-urls -->
12
# YAML Examples
23

34
This folder is going to house some example YAMLs that will make the test suite fail if applied to a cluster. Not all test suites have an example to show but more examples can be added in the future.
@@ -7,6 +8,7 @@ Please refer to the [CATALOG](https://github.com/test-network-function/test-netw
78
## Examples by Test Suite
89

910
Please find an example below that ties to a specific test case you are interested in.
11+
1012
### accesscontrol
1113

1214
* [cluster-role-bindings](examples/accesscontrol/clusterRoleBinding.yaml) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#cluster-role-bindings)
@@ -21,24 +23,21 @@ Creates necessary cluster role, role binding, service account, and pod that caus
2123

2224
* namespace (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#namespace)
2325

24-
* [pod-automount-service-account-token](examples/accesscontrol/serviceAccountTokenPod.yaml) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#pod-automount-service-account-token)
26+
* [pod-automount-service-account-token](examples/accesscontrol/serviceAccountTokenPod.yaml) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#pod-automount-service-account-token)
2527

2628
* [pod-role-bindings](examples/accesscontrol/podRoleBinding.yaml) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#pod-role-bindings)
2729

2830
Creates necessary role, role binding, service account, and pod that causes a failure in the `accesscontrol` suite of tests because the rolebinding cannot cross namespaces.
2931

3032
* [pod-service-account](examples/accesscontrol/serviceAccountPod.yaml) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#pod-service-account)
3133

32-
33-
3434
### affiliated-certification
3535

36-
No examples to show (yet)....
36+
No examples to show (yet)
3737

3838
* container-is-certified (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#container-is-certified)
3939
* operator-is-certified (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#operator-is-certified)
4040

41-
4241
### lifecycle
4342

4443
Note: We might need the following flag set in the environment in which you are testing these YAMLs to avoid any draining, cluster-intrusive issues, etc.
@@ -72,7 +71,6 @@ Creates a pod with no "owner". It does not belong to a replicaset or a deployme
7271

7372
* stateful-scaling (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#statefulset-scaling)
7473

75-
7674
### networking
7775

7876
* icmpv4-connectivity (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#icmpv4-connectivity)
@@ -104,4 +102,3 @@ Creates an `echo-server` pod which does some logging to the stdout. The test ch
104102
* isredhat-release (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#isredhat-release)
105103
* sysctl-config (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#sysctl-config)
106104
* tainted-node-kernel (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#tainted-node-kernel)
107-

0 commit comments

Comments
 (0)