You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB

8 years ago
8 years ago
8 years ago
  1. #! /bin/bash
  2. global_setup() {
  3. git clone https://github.com/ansibl8s/setup-kubernetes.git setup-kubernetes
  4. private_key=""
  5. if [ ! -z ${PRIVATE_KEY_FILE} ]
  6. then
  7. private_key="--private-key=${PRIVATE_KEY_FILE}"
  8. fi
  9. ansible-playbook create.yml -i hosts -u admin -s \
  10. -e test_id=${TEST_ID} \
  11. -e kube_network_plugin=${KUBE_NETWORK_PLUGIN} \
  12. -e aws_access_key=${AWS_ACCESS_KEY} \
  13. -e aws_secret_key=${AWS_SECRET_KEY} \
  14. -e aws_ami_id=${AWS_AMI_ID} \
  15. -e aws_security_group=${AWS_SECURITY_GROUP} \
  16. -e key_name=${AWS_KEY_PAIR_NAME} \
  17. -e inventory_path=${PWD}/inventory.ini \
  18. -e aws_region=${AWS_REGION}
  19. }
  20. global_teardown() {
  21. if [ -f inventory.ini ];
  22. then
  23. ansible-playbook -i inventory.ini -u admin delete.yml
  24. fi
  25. rm -rf ${PWD}/setup-kubernetes
  26. }
  27. should_deploy_cluster() {
  28. ansible-playbook -i inventory.ini -s ${private_key} -e kube_network_plugin=${KUBE_NETWORK_PLUGIN} setup-kubernetes/cluster.yml
  29. assertion__status_code_is_success $?
  30. }
  31. should_api_server_respond() {
  32. ansible-playbook -i inventory.ini ${private_key} testcases/010_check-apiserver.yml
  33. assertion__status_code_is_success $?
  34. }
  35. should_create_pod() {
  36. ansible-playbook -i inventory.ini -s ${private_key} testcases/020_check-create-pod.yml -vv
  37. assertion__status_code_is_success $?
  38. }
  39. should_pod_be_in_expected_subnet() {
  40. ansible-playbook -i inventory.ini -s ${private_key} testcases/030_check-network.yml -vv
  41. assertion__status_code_is_success $?
  42. }