Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ workflows:
- build-oci-images:
<<: *run_for_numeric_tags
image_tag: << pipeline.git.tag >>
- e2e:
<<: *run_for_numeric_tags
image_tag: << pipeline.git.tag >>
requires:
- build-oci-images
- build-all
- publish-oci-images:
<<: *run_for_numeric_tags
<<: *v2_release_requires
Expand Down Expand Up @@ -195,6 +201,7 @@ workflows:
<<: *run_for_all_branches
- e2e:
<<: *run_for_all_branches
image_tag: v2-dev
requires:
- build-oci-images
- build-all
Expand Down Expand Up @@ -268,6 +275,10 @@ jobs:
destination: test-artifacts
e2e:
executor: local_cluster_test_executor
parameters:
image_tag:
type: string
default: "v2-dev"
steps:
- checkout
- kubectl-install
Expand Down Expand Up @@ -335,11 +346,13 @@ jobs:
# the connector in east
kubectl wait listener/backend \
--timeout=60s \
'--for=jsonpath={.status.hasMatchingConnector}=true'
'--for=jsonpath={.status.hasMatchingConnector}=true'
- run:
name: Running E2E Tests
command: |
set -x
export SKUPPER_SYSTEM_CONTROLLER_IMAGE="quay.io/skupper/cli:<< parameters.image_tag >>"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Env var is correct, but the image is wrong.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry!

export SKUPPER_CLI_IMAGE="quay.io/skupper/cli:<< parameters.image_tag >>"
Comment thread
fgiorgetti marked this conversation as resolved.
cd tests
cp ~/kc.west ~/.kube/config
make ci-tests
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ EXTRA_VARS := --extra-vars "@$(ROOT_PATH)/vars.yml"
COLLECTION_PATH := $(ROOT_PATH)/e2e/collections/ansible_collections/e2e/tests
# Remove expose-pods-by-name from the CI tests, until we close
# this issue https://github.com/skupperproject/skupper/issues/2251
TESTS_CI := attached-connector,ha,hello-world,labels-and-annotations
TESTS_CI := attached-connector,ha,hello-world,labels-and-annotations,system-sites

# E2E Test directories
E2E_TEST_DIRS := $(sort $(wildcard $(ROOT_PATH)/e2e/scenarios/*))
Expand Down
8 changes: 8 additions & 0 deletions tests/e2e/scenarios/system-sites/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[defaults]
collections_path = ../../collections
roles_path = ../../collections/ansible_collections/e2e/tests/roles
deprecation_warnings = False

[persistent_connection]
connect_timeout = 30
command_timeout = 30
36 changes: 36 additions & 0 deletions tests/e2e/scenarios/system-sites/cleanup-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
- name: "[ {{ test_identifier }} ] - Cleanup frontend container"
ansible.builtin.command:
cmd: "{{ platform }} rm -f frontend"
failed_when: false
when:
- not skip_teardown | default(false) | bool
- "'west' in inventory_hostname"

- name: "[ {{ test_identifier }} ] - Cleanup backend container"
ansible.builtin.command:
cmd: "{{ platform }} rm -f backend"
failed_when: false
when:
- not skip_teardown | default(false) | bool
- "'east' in inventory_hostname"

- name: "[ {{ test_identifier }} ] - Stop namespaces"
skupper.v2.system:
action: stop
Comment thread
fgiorgetti marked this conversation as resolved.
namespace: "{{ namespace_name }}"
platform: "{{ platform }}"
image: "{{ skupper_cli_image }}"
failed_when: false
when: not skip_teardown | default(false) | bool

- name: "[ {{ test_identifier }} ] - Uninstall system controller"
skupper.v2.controller:
action: uninstall
platform: "{{ platform }}"
image: "{{ skupper_system_controller_image }}"
failed_when: false
run_once: true
when: not skip_teardown | default(false) | bool


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
ansible_connection: local
ansible_user: "{{ lookup('env', 'USER') }}"
ansible_python_interpreter: /usr/bin/python3
debug: false
namespace_prefix: "e2e-system-sites"
skupper_cli_image: "{{ lookup('ansible.builtin.env', 'SKUPPER_CLI_IMAGE') | default('quay.io/skupper/cli:v2-dev', true) }}"
skupper_system_controller_image: "{{ lookup('ansible.builtin.env', 'SKUPPER_SYSTEM_CONTROLLER_IMAGE') | default('quay.io/skupper/system-controller:v2-dev', true) }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
# Platform configuration
platform: docker
namespace_name: east
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# Platform configuration
platform: docker
namespace_name: west

5 changes: 5 additions & 0 deletions tests/e2e/scenarios/system-sites/inventory/hosts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
all:
hosts:
west:
east:
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: skupper.io/v2alpha1
kind: Connector
metadata:
name: backend
spec:
routingKey: backend
port: 9090
host: 127.0.0.1
5 changes: 5 additions & 0 deletions tests/e2e/scenarios/system-sites/resources/east/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: east
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: skupper.io/v2alpha1
kind: Listener
metadata:
name: backend
spec:
routingKey: backend
port: 8080
host: 127.0.0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: skupper.io/v2alpha1
kind: RouterAccess
metadata:
name: router-access-west
namespace: west
spec:
roles:
- name: inter-router
port: 55671
- name: edge
port: 45671
subjectAlternativeNames:
- 0.0.0.0
- '::'
7 changes: 7 additions & 0 deletions tests/e2e/scenarios/system-sites/resources/west/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: west
spec:
linkAccess: default
97 changes: 97 additions & 0 deletions tests/e2e/scenarios/system-sites/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
- name: Hello World System Sites Test (Manual Reload)
hosts: all
roles:
- e2e.tests.skupper_test_images

vars:
test_identifier: "Hello World with System Sites (Manual Reload)"

environment:
SKUPPER_PLATFORM: "{{ platform }}"

tasks:
# Pre-test cleanup
- name: "[ {{ test_identifier }} ] - Pre-test cleanup"
ansible.builtin.include_tasks: cleanup-tasks.yml

- name: "[ {{ test_identifier }} ] - Main test block"
block:
- name: "[ {{ test_identifier }} ] - Install system controller"
skupper.v2.controller:
action: install
Comment thread
fgiorgetti marked this conversation as resolved.
platform: "{{ platform }}"
image: "{{ skupper_system_controller_image }}"
run_once: true
delegate_to: localhost
register: system_install

# West Site - Setup and get token
- name: "[ {{ test_identifier }} ] - West Site Setup"
block:
- name: "[ {{ test_identifier }} ] - Deploy frontend service"
ansible.builtin.shell:
cmd: "{{ platform }} run --name frontend -d --rm -p 127.0.0.1:7070:8080 quay.io/skupper/hello-world-frontend --backend http://host.containers.internal:8080"
changed_when: false

- name: "[ {{ test_identifier }} ] - Apply west site resources"
skupper.v2.resource:
path: "{{ playbook_dir }}/resources/west/"
platform: "{{ platform }}"
namespace: "{{ namespace_name }}"

- name: "[ {{ test_identifier }} ] - Start west namespace"
skupper.v2.system:
action: start
Comment thread
fgiorgetti marked this conversation as resolved.
platform: "{{ platform }}"
namespace: "{{ namespace_name }}"
image: "{{ skupper_cli_image }}"
register: west

when: "'west' in inventory_hostname"
run_once: true

# East Site - Must run after token is created
- name: "[ {{ test_identifier }} ] - East Site Setup"
block:
- name: "[ {{ test_identifier }} ] - Deploy backend service"
ansible.builtin.shell:
cmd: "{{ platform }} run --name backend -d --rm -p 127.0.0.1:9090:8080 quay.io/skupper/hello-world-backend"
changed_when: false
register: backend_deploy

- name: "[ {{ test_identifier }} ] - Apply east site resources"
skupper.v2.resource:
path: "{{ playbook_dir }}/resources/east/"
platform: "{{ platform }}"
namespace: "{{ namespace_name }}"

- name: "[ {{ test_identifier }} ] - Apply token to east site"
skupper.v2.resource:
def: "{{ west.links['0.0.0.0'] }}"
namespace: "{{ namespace_name }}"
platform: "{{ platform }}"

- name: "[ {{ test_identifier }} ] - Start east namespace"
skupper.v2.system:
action: start
Comment thread
fgiorgetti marked this conversation as resolved.
platform: "{{ platform }}"
namespace: "{{ namespace_name }}"
image: "{{ skupper_cli_image }}"
register: east
when: "'east' in inventory_hostname"

# Verify connectivity - test if backend is accessible from frontend container
- name: "[ {{ test_identifier }} ] - Test via Skupper (listener)"
ansible.builtin.command:
cmd: "curl -s -f http://127.0.0.1:8080/api/hello"
register: curl_result
retries: 10
delay: 10
until: curl_result.rc == 0
when: "'west' in inventory_hostname"
changed_when: false

always:
- name: "[ {{ test_identifier }} ] - Post-test cleanup"
ansible.builtin.include_tasks: cleanup-tasks.yml
Loading