test-210-stretch-overlap.sh 1.1 KB

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. set -xeuo pipefail
  3. CONFFILE="stretch-overlap.yaml"
  4. NAMESPACE="stretch-overlap"
  5. OUTFILE="overlap-test.log"
  6. kubectl create namespace "$NAMESPACE"
  7. sed \
  8. -e "s|namespace:.*|namespace: $NAMESPACE|" \
  9. -e 's|publicNetwork:.*|publicNetwork: "default/public-net"|' \
  10. -e 's|clusterNetwork:.*|clusterNetwork: "default/cluster-net"|' \
  11. tests/scripts/multus/stretch.yaml >"$CONFFILE"
  12. cat "$CONFFILE"
  13. # Nodes do not yet have taints, which means worker and storage node type pods should overlap
  14. # this is an important error condition to check because it ensures the test is valid
  15. if ./rook --log-level DEBUG multus validation run --config "$CONFFILE" 2>&1 | tee "$OUTFILE"; then
  16. echo "Test was supposed to fail"
  17. exit 1
  18. fi
  19. # Check that node overlap error is present
  20. grep 'RESULT: multus validation test failed: multus validation test failed: node types must not overlap: node type "worker-nodes" has overlap with node type "storage-nodes"' "$OUTFILE"
  21. # should be resources left running for debugging
  22. [[ -n "$(kubectl --namespace "$NAMESPACE" get pods --no-headers 2>/dev/null | grep -v Terminating)" ]]