Loading modules/cloud_service_providers/k8s/tests/src/Behat/features/templates/K8s-ATDD-00-01-AdminCreateResources.feature +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,12 @@ Feature: Create resources for K8s as "Administrator" And I should see "{{ role_name }}" Then I visit "admin/people/permissions/{{ role_name_machine }}" # Need to set "any" since each scenario creates a new user. # Access entities And I check the box "Access entities belonging to k8s namespace default" And I check the box "Access entities belonging to k8s namespace kube-node-lease" And I check the box "Access entities belonging to k8s namespace kube-public" And I check the box "Access entities belonging to k8s namespace kube-system" And I check the box "Access entities belonging to k8s namespace kubernetes-dashboard" # Delete permission And I check the box "Delete any K8s API service" And I check the box "Delete any K8s ConfigMap" Loading modules/cloud_service_providers/k8s/tests/src/Behat/features/templates/K8s-ATDD-00-04-UserCreateResources.feature 0 → 100644 +71 −0 Original line number Diff line number Diff line Feature: Create resources for K8s as "Authenticated User" As a user I need to create pod and deployment @api Scenario: Log into the site Given I am logged in as a user with the "{{ role_name }}" role When I visit "/clouds" Then I should see the heading "Cloud service providers" And I should see the link "All" in the "nav_bar" And I should see the link "K8s" in the "nav_bar" @api @javascript Scenario: Create a pod Given I am logged in as a user with the "{{ role_name }}" role When I visit "/clouds/k8s/{{ cloud_context }}/pod/add" And I should see the heading "Add Pod" And I select "{{ namespace }}" from "Namespace" And I fill in "Detail" with: """ apiVersion: v1 kind: Pod metadata: name: {{ pod_name }} spec: containers: - name: {{ container_name }} image: {{ image_version }} ports: - containerPort: {{ port }} """ And I press "Save" And I wait for AJAX to finish Then the url should match "/clouds/k8s/{{ cloud_context }}/pod" And I should see "has been created" And I should see "nginx" in the "{{ namespace }}" row @api @javascript Scenario: Create a deployment Given I am logged in as a user with the "{{ role_name }}" role When I visit "/clouds/k8s/{{ cloud_context }}/deployment/add" And I select "{{ namespace }}" from "Namespace" And I fill in "Detail" with: """ apiVersion: apps/v1 kind: Deployment metadata: name: {{ deployment_name }} labels: app: {{ app_name }} spec: replicas: {{ replica_count }} selector: matchLabels: app: {{ app_name }} template: metadata: labels: app: {{ app_name }} spec: containers: - name: {{ container_name }} image: {{ image_version }} ports: - containerPort: {{ port }} """ And I press "Save" And I wait for AJAX to finish Then I should be on "/clouds/k8s/{{ cloud_context }}/deployment" And I should see "has been created" And I should see "nginx-deployment" in the "{{ namespace }}" row modules/cloud_service_providers/k8s/tests/src/Behat/features/templates/params/k8s_params.yml +16 −0 Original line number Diff line number Diff line Loading @@ -2,13 +2,29 @@ # '@Random' is a reserved term to be replaced by a random string. # '@random' is in lower cases, and '@RANDOM' is in uppercase. app_name: nginx cloud_context: # The region is automatically set as suffix. bdd_k8s_@random container_name: nginx deployment_name: nginx-deployment image_version: nginx:1.14.2 k8s_cloud_service_provider_name_entered: BDD_K8s_@Random k8s_cloud_service_provider_name: BDD_K8s_@Random namespace: default pod_name: nginx port: 80 replica_count: 3 role_name: BDD_Role_@Random role_name_machine: Loading Loading
modules/cloud_service_providers/k8s/tests/src/Behat/features/templates/K8s-ATDD-00-01-AdminCreateResources.feature +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,12 @@ Feature: Create resources for K8s as "Administrator" And I should see "{{ role_name }}" Then I visit "admin/people/permissions/{{ role_name_machine }}" # Need to set "any" since each scenario creates a new user. # Access entities And I check the box "Access entities belonging to k8s namespace default" And I check the box "Access entities belonging to k8s namespace kube-node-lease" And I check the box "Access entities belonging to k8s namespace kube-public" And I check the box "Access entities belonging to k8s namespace kube-system" And I check the box "Access entities belonging to k8s namespace kubernetes-dashboard" # Delete permission And I check the box "Delete any K8s API service" And I check the box "Delete any K8s ConfigMap" Loading
modules/cloud_service_providers/k8s/tests/src/Behat/features/templates/K8s-ATDD-00-04-UserCreateResources.feature 0 → 100644 +71 −0 Original line number Diff line number Diff line Feature: Create resources for K8s as "Authenticated User" As a user I need to create pod and deployment @api Scenario: Log into the site Given I am logged in as a user with the "{{ role_name }}" role When I visit "/clouds" Then I should see the heading "Cloud service providers" And I should see the link "All" in the "nav_bar" And I should see the link "K8s" in the "nav_bar" @api @javascript Scenario: Create a pod Given I am logged in as a user with the "{{ role_name }}" role When I visit "/clouds/k8s/{{ cloud_context }}/pod/add" And I should see the heading "Add Pod" And I select "{{ namespace }}" from "Namespace" And I fill in "Detail" with: """ apiVersion: v1 kind: Pod metadata: name: {{ pod_name }} spec: containers: - name: {{ container_name }} image: {{ image_version }} ports: - containerPort: {{ port }} """ And I press "Save" And I wait for AJAX to finish Then the url should match "/clouds/k8s/{{ cloud_context }}/pod" And I should see "has been created" And I should see "nginx" in the "{{ namespace }}" row @api @javascript Scenario: Create a deployment Given I am logged in as a user with the "{{ role_name }}" role When I visit "/clouds/k8s/{{ cloud_context }}/deployment/add" And I select "{{ namespace }}" from "Namespace" And I fill in "Detail" with: """ apiVersion: apps/v1 kind: Deployment metadata: name: {{ deployment_name }} labels: app: {{ app_name }} spec: replicas: {{ replica_count }} selector: matchLabels: app: {{ app_name }} template: metadata: labels: app: {{ app_name }} spec: containers: - name: {{ container_name }} image: {{ image_version }} ports: - containerPort: {{ port }} """ And I press "Save" And I wait for AJAX to finish Then I should be on "/clouds/k8s/{{ cloud_context }}/deployment" And I should see "has been created" And I should see "nginx-deployment" in the "{{ namespace }}" row
modules/cloud_service_providers/k8s/tests/src/Behat/features/templates/params/k8s_params.yml +16 −0 Original line number Diff line number Diff line Loading @@ -2,13 +2,29 @@ # '@Random' is a reserved term to be replaced by a random string. # '@random' is in lower cases, and '@RANDOM' is in uppercase. app_name: nginx cloud_context: # The region is automatically set as suffix. bdd_k8s_@random container_name: nginx deployment_name: nginx-deployment image_version: nginx:1.14.2 k8s_cloud_service_provider_name_entered: BDD_K8s_@Random k8s_cloud_service_provider_name: BDD_K8s_@Random namespace: default pod_name: nginx port: 80 replica_count: 3 role_name: BDD_Role_@Random role_name_machine: Loading