-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a copy of the existing remote shell tests, just pointing at the new ssh-portal endpoint.
- Loading branch information
Showing
7 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- name: "{{ testname }} - running {{ command }} on {{ username }}@{{ ssh_portal_host }} on port {{ ssh_portal_port }}, searching for '{{ expected_content }}'" | ||
shell: ssh {{ username }}@{{ ssh_portal_host }} -p {{ ssh_portal_port }} {{ command }} | ||
register: result | ||
until: result.stdout is search(expected_content) | ||
retries: 30 | ||
delay: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
- name: "{{ testname }} - init git, add files, commit, git push" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
git_files: "node{{ node_version }}/" | ||
tasks: | ||
- include: ../../tasks/git-init.yaml | ||
- include: ../../tasks/git-add-commit-push.yaml | ||
|
||
- name: "{{ testname }} - api deployEnvironmentBranch on {{ project }}, which should deploy the first commit" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
branch: "{{ branch }}" | ||
project: "{{ project }}" | ||
namespace: "{{ project | regex_replace('_', '-') }}-{{ branch | regex_replace('/', '-') }}" | ||
tasks: | ||
- include: ../../tasks/api/deploy-no-sha.yaml | ||
|
||
- name: "{{ testname }} - check if we can connect via oc project user" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
username: "{{ project }}-remoteshell" | ||
command: service=node env | ||
expected_content: "LAGOON_PROJECT={{ project }}" | ||
tasks: | ||
- include: ../../tasks/ssh/ssh-portal-command.yaml | ||
|
||
- name: "{{ testname }} - check if we can connect via oc project user and defining the container" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
username: "{{ project }}-remoteshell" | ||
command: service=node container=node env | ||
expected_content: "LAGOON_PROJECT={{ project }}" | ||
tasks: | ||
- include: ../../tasks/ssh/ssh-portal-command.yaml | ||
|
||
- name: "{{ testname }} - check if we are on the right git hash via oc project user" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
username: "{{ project }}-remoteshell" | ||
command: service=node env | ||
expected_content: "LAGOON_GIT_SHA={{ current_head }}" | ||
tasks: | ||
- include: ../../tasks/ssh/ssh-portal-command.yaml | ||
|
||
- name: "{{ testname }} - check if we are on the right git branch via oc project user" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
username: "{{ project }}-remoteshell" | ||
command: service=node env | ||
expected_content: "LAGOON_GIT_BRANCH={{ branch }}" | ||
tasks: | ||
- include: ../../tasks/ssh/ssh-portal-command.yaml | ||
|
||
- name: "{{ testname }} - api deleteEnvironment on {{ project }}, which should remove all resources" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
project: "{{ project }}" | ||
branch: "{{ branch }}" | ||
tasks: | ||
- include: ../../tasks/api/delete-environment.yaml | ||
|
||
- name: "{{ testname }} - check if site for {{ project }} does not exist anymore" | ||
hosts: localhost | ||
serial: 1 | ||
vars: | ||
url: "{{ check_url }}" | ||
expected_returncode: "{{ del_status_code }}" | ||
tasks: | ||
- include: ../../checks/check-url-returncode.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- include: features/random-wait.yaml | ||
|
||
- include: features/api-token.yaml | ||
vars: | ||
testname: "API TOKEN" | ||
|
||
- include: api/add-project.yaml | ||
vars: | ||
project: ci-ssh-portal-{{ cluster_type }} | ||
git_repo_name: features.git | ||
git_url: "{{ localgit_url }}/{{ git_repo_name }}" | ||
|
||
- include: features/remote-ssh-portal.yaml | ||
vars: | ||
testname: "REMOTE SSH PORTAL {{ cluster_type|upper }}" | ||
node_version: 16 | ||
git_repo_name: features.git | ||
project: ci-ssh-portal-{{ cluster_type }} | ||
branch: remoteshell | ||
check_url: "http://node.{{ project | regex_replace('_', '-') }}.{{ branch | regex_replace('/', '-') }}.{{ route_suffix }}" | ||
ssh_host: "{{ ssh_portal_host }}" | ||
ssh_auth_port: "{{ ssh_portal_port }}" | ||
|
||
- include: api/delete-project.yaml | ||
vars: | ||
project: ci-ssh-portal-{{ cluster_type }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters