test-240-stretch-cluster-only.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. set -xeuo pipefail
  3. CONFFILE="stretch-cluster-only.yaml"
  4. NAMESPACE="stretch-cluster-only"
  5. OUTFILE="stretch-cluster-test.log"
  6. kubectl create namespace "$NAMESPACE"
  7. sed \
  8. -e "s|namespace:.*|namespace: $NAMESPACE|" \
  9. -e 's|publicNetwork:.*|publicNetwork: ""|' \
  10. -e 's|clusterNetwork:.*|clusterNetwork: "default/cluster-net"|' \
  11. tests/scripts/multus/stretch.yaml >"$CONFFILE"
  12. cat "$CONFFILE"
  13. ./rook --log-level DEBUG multus validation run --config "$CONFFILE" 2>&1 | tee "$OUTFILE"
  14. # only OSDs get cluster network, so only OSD test pods should start running
  15. # 3 node types:
  16. # arbiter-node (1 node, on control-plane)
  17. grep 'starting 0 osd validation clients for node type "arbiter-node"' "$OUTFILE"
  18. # storage-nodes (2 nodes)
  19. grep 'starting 2 osd validation clients for node type "storage-nodes"' "$OUTFILE"
  20. # worker-nodes (1 node)
  21. grep 'starting 0 osd validation clients for node type "worker-nodes"' "$OUTFILE"
  22. # total
  23. grep "all 4 clients are 'Ready'" "$OUTFILE"
  24. # should be no non-terminating resources in namespace after successful test
  25. [[ -z "$(kubectl --namespace "$NAMESPACE" get pods --no-headers 2>/dev/null | grep -v Terminating)" ]]