test_jupyterhub.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. # OMNIA_UKP_US_VFKP_TC_014
  16. # Execute jupyterhub role in manager nodes with os installed centos 7.9
  17. - name: OMNIA_UKP_US_VFKP_TC_014
  18. hosts: manager
  19. gather_facts: false
  20. vars_files:
  21. - test_vars/test_jupyterhub_vars.yml
  22. tasks:
  23. - block:
  24. - name: Call jupyterhub role
  25. include_role:
  26. name: ../platforms/roles/jupyterhub
  27. tags: TC_014
  28. - name: Waiting for the pods deployment
  29. pause:
  30. minutes: 5
  31. tags: TC_014
  32. - name: Checking all running pods under default namespace
  33. command: kubectl get pods --namespace default --field-selector=status.phase=Running
  34. register: namesapce_default_running_pods
  35. changed_when: false
  36. ignore_errors: True
  37. tags: TC_014, VERIFY_014
  38. - name: Checking K8s services
  39. command: kubectl get services
  40. register: k8s_services
  41. changed_when: false
  42. ignore_errors: True
  43. tags: TC_014, VERIFY_014
  44. - name: Validating JupyterHub pods
  45. assert:
  46. that:
  47. - "'hub' in namesapce_default_running_pods.stdout"
  48. - "'proxy' in namesapce_default_running_pods.stdout"
  49. fail_msg: "{{ jupyterhub_pods_fail_msg }}"
  50. success_msg: "{{ jupyterhub_pods_success_msg }}"
  51. tags: TC_014, VERIFY_014
  52. - name: Validating JupyterHub services
  53. assert:
  54. that:
  55. - "'hub' in k8s_services.stdout"
  56. - "'proxy-public' in k8s_services.stdout"
  57. - "'proxy-api' in k8s_services.stdout"
  58. fail_msg: "{{ jupyterhub_services_fail_msg }}"
  59. success_msg: "{{ jupyterhub_services_success_msg }}"
  60. tags: TC_014, VERIFY_014
  61. # OMNIA_UKP_US_VFKP_TC_015
  62. # Execute jupyterhub role in manager nodes with JupyterHub already deployed
  63. - name: OMNIA_UKP_US_VFKP_TC_015
  64. hosts: manager
  65. gather_facts: false
  66. vars_files:
  67. - test_vars/test_jupyterhub_vars.yml
  68. tasks:
  69. - block:
  70. - name: Call jupyterhub role
  71. include_role:
  72. name: ../platforms/roles/jupyterhub
  73. tags: TC_015, VERIFY_015
  74. - name: Checking all running pods under default namespace
  75. command: kubectl get pods --namespace default --field-selector=status.phase=Running
  76. register: namesapce_default_running_pods
  77. changed_when: false
  78. ignore_errors: True
  79. tags: TC_015, VERIFY_015
  80. - name: Checking K8s services
  81. command: kubectl get services
  82. register: k8s_services
  83. changed_when: false
  84. ignore_errors: True
  85. tags: TC_015, VERIFY_015
  86. - name: Validating JupyterHub pods
  87. assert:
  88. that:
  89. - "'hub' in namesapce_default_running_pods.stdout"
  90. - "'proxy' in namesapce_default_running_pods.stdout"
  91. fail_msg: "{{ jupyterhub_pods_fail_msg }}"
  92. success_msg: "{{ jupyterhub_pods_success_msg }}"
  93. tags: TC_015, VERIFY_015
  94. - name: Validating JupyterHub services
  95. assert:
  96. that:
  97. - "'hub' in k8s_services.stdout"
  98. - "'proxy-public' in k8s_services.stdout"
  99. - "'proxy-api' in k8s_services.stdout"
  100. fail_msg: "{{ jupyterhub_services_fail_msg }}"
  101. success_msg: "{{ jupyterhub_services_success_msg }}"
  102. tags: TC_015, VERIFY_015