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

Fix SR-IOV tests #328

Merged
merged 1 commit into from
Feb 18, 2021
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
2 changes: 1 addition & 1 deletion apps/nsc-kernel-ponger/ponger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- name: ponger
image: frolvlad/alpine-bash:latest
imagePullPolicy: IfNotPresent
command: ["bin/bash", "root/scripts/pong.sh", "eno4", "10.0.0.200/32", "10.0.0.201/32"]
command: ["bin/bash", "root/scripts/pong.sh", "eno4", "172.16.1.100/32", "172.16.1.101/32"]
securityContext:
privileged: true
volumeMounts:
Expand Down
9 changes: 3 additions & 6 deletions examples/use-cases/Kernel2Kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ spec:
env:
- name: NSE_CIDR_PREFIX
value: 172.16.1.100/31
- name: NSM_NETWORK_SERVICES
value: kernel://icmp-responder/nsm-1
nodeSelector:
kubernetes.io/hostname: ${NODE}
EOF
Expand All @@ -102,21 +100,20 @@ kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc -n ${NAMESPACE}
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse -n ${NAMESPACE}
```

Find nsc and nse pods by labesl:
Find nsc and nse pods by labels:
```bash
NSC=$(kubectl get pods -l app=nsc -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

```bash
NSE=$(kubectl get pods -l app=nse -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

Ping from nsc to nse:
Ping from NSC to NSE:
```bash
kubectl exec ${NSC} -n ${NAMESPACE} -- ping -c 4 172.16.1.100
```

Ping from nse to nsc:
Ping from NSE to NSC:
```bash
kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101
```
Expand Down
9 changes: 3 additions & 6 deletions examples/use-cases/Kernel2Vxlan2Kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ spec:
env:
- name: NSE_CIDR_PREFIX
value: 172.16.1.100/31
- name: NSM_NETWORK_SERVICES
value: kernel://icmp-responder/nsm-1
nodeSelector:
kubernetes.io/hostname: ${NODES[1]}
EOF
Expand All @@ -102,21 +100,20 @@ kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc -n ${NAMESPACE}
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse -n ${NAMESPACE}
```

Find nsc and nse pods by labels:
Find NSC and NSE pods by labels:
```bash
NSC=$(kubectl get pods -l app=nsc -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

```bash
NSE=$(kubectl get pods -l app=nse -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

Ping from nsc to nse:
Ping from NSC to NSE:
```bash
kubectl exec ${NSC} -n ${NAMESPACE} -- ping -c 4 172.16.1.100
```

Ping from nse to nsc:
Ping from NSE to NSC:
```bash
kubectl exec ${NSE} -n ${NAMESPACE} -- ping -c 4 172.16.1.101
```
Expand Down
5 changes: 2 additions & 3 deletions examples/use-cases/Memif2Memif/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,17 @@ kubectl apply -k .
```

Wait for applications ready:
```bash
```bash
kubectl wait --for=condition=ready --timeout=1m pod -l app=nsc -n ${NAMESPACE}
```
```bash
kubectl wait --for=condition=ready --timeout=1m pod -l app=nse -n ${NAMESPACE}
```

Find nsc and nse pods by labesl:
Find NSC and NSE pods by labels:
```bash
NSC=$(kubectl get pods -l app=nsc -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

```bash
NSE=$(kubectl get pods -l app=nse -n ${NAMESPACE} --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```
Expand Down
27 changes: 4 additions & 23 deletions examples/use-cases/SriovKernel2Noop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
- name: NSE_LABELS
value: serviceDomain:worker.domain
- name: NSE_CIDR_PREFIX
value: 10.0.0.200/31
value: 172.16.1.100/31
resources:
limits:
master.domain/10G: 1
Expand All @@ -105,31 +105,12 @@ kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=ponge

Get NSC pod:
```bash
NSC_POD=$(kubectl -n ${NAMESPACE} get pods -l app=nsc |
grep -v "NAME" |
sed -E "s/([.]*) .*/\1/g")
NSC=$(kubectl -n ${NAMESPACE} get pods -l app=nsc --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

Check connection result:
Ping from NSC to NSE:
```bash
kubectl -n ${NAMESPACE} logs ${NSC_POD} |
grep "All client init operations are done."
```

Test connection:
```bash
PING_RESULTS=$(kubectl -n ${NAMESPACE} exec ${NSC_POD} -- ping -c 10 -W 1 10.0.0.200 2>&1) \
|| (echo "${PING_RESULTS}" 1>&2 && false)
```
```bash
PACKET_LOSS="$(echo "${PING_RESULTS}" |
grep "packet loss" |
sed -E 's/.* ([0-9]*)(\.[0-9]*)?% packet loss/\1/g')" \
|| (echo "${PING_RESULTS}" 1>&2 && false)
```
```bash
test "${PACKET_LOSS}" -ne 100 \
|| (echo "${PING_RESULTS}" 1>&2 && false)
kubectl -n ${NAMESPACE} exec ${NSC} -- ping -c 4 172.16.1.100
```

## Cleanup
Expand Down
34 changes: 14 additions & 20 deletions examples/use-cases/Vfio2Noop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kind: Kustomization
namespace: ${NAMESPACE}

bases:
- ../../../apps/vfio-nsc
- ../../../apps/nsc-vfio
- ../../../apps/nse-vfio
EOF
```
Expand All @@ -50,33 +50,29 @@ kubectl -n ${NAMESPACE} wait --for=condition=ready --timeout=1m pod -l app=nse

Get NSC pod:
```bash
NSC_POD=$(kubectl -n ${NAMESPACE} get pods -l app=nsc |
grep -v "NAME" |
sed -E "s/([.]*) .*/\1/g")
NSC=$(kubectl -n ${NAMESPACE} get pods -l app=nsc --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```

Check connection result:
```bash
kubectl -n ${NAMESPACE} logs ${NSC_POD} sidecar |
kubectl -n ${NAMESPACE} logs ${NSC} sidecar |
grep "All client init operations are done."
```

Test connection:
```bash
PING_RESULTS=$(kubectl -n ${NAMESPACE} exec ${NSC_POD} --container pinger -- /bin/bash -c ' \
/root/dpdk-pingpong/build/app/pingpong \
--no-huge \
-- \
-n 500 \
-c \
-C 0a:11:22:33:44:55 \
-S 0a:55:44:33:22:11 \
PING_RESULTS=$(kubectl -n ${NAMESPACE} exec ${NSC} --container pinger -- /bin/bash -c ' \
/root/dpdk-pingpong/build/app/pingpong \
--no-huge \
-- \
-n 500 \
-c \
-C 0a:11:22:33:44:55 \
-S 0a:55:44:33:22:11 \
' 2>&1) || (echo "${PING_RESULTS}" 1>&2 && false)
```
```bash
PONG_PACKETS="$(echo "${PING_RESULTS}" |
grep "rx .* pong packets" |
sed -E 's/rx ([0-9]*) pong packets/\1/g')" \
PONG_PACKETS="$(echo "${PING_RESULTS}" | grep "rx .* pong packets" | sed -E 's/rx ([0-9]*) pong packets/\1/g')" \
|| (echo "${PING_RESULTS}" 1>&2 && false)
```
```bash
Expand All @@ -88,12 +84,10 @@ test "${PONG_PACKETS}" -ne 0 \

Stop ponger:
```bash
NSE_POD=$(kubectl -n ${NAMESPACE} get pods -l app=nse |
grep -v "NAME" |
sed -E "s/([.]*) .*/\1/g")
NSE=$(kubectl -n ${NAMESPACE} get pods -l app=nse --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
```
```bash
kubectl -n ${NAMESPACE} exec ${NSE_POD} --container ponger -- /bin/bash -c ' \
kubectl -n ${NAMESPACE} exec ${NSE} --container ponger -- /bin/bash -c ' \
sleep 10 && kill $(ps -A | grep "pingpong" | sed -E "s/ *([0-9]*).*/\1/g") 1>/dev/null 2>&1 & \
'
```
Expand Down