Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci add gh actions acceptance tests coverage #8929

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3825109
CI: skip scheduled actions on forks
jordimassaguerpla Apr 3, 2024
01c5240
CI: add auth registry
jordimassaguerpla May 28, 2024
3d5187c
CI: add buildhost
jordimassaguerpla May 29, 2024
7af0659
CI: Add monitoring feature
jordimassaguerpla May 30, 2024
e48f108
CI: enable deblike_minion tests
jordimassaguerpla Apr 3, 2024
f399049
CI: Add srv notification test
jordimassaguerpla Apr 3, 2024
43e7aa3
CI: Enable openscap test
jordimassaguerpla Apr 3, 2024
19b1420
CI: fix ansible and prometheus tests
jordimassaguerpla Apr 4, 2024
23ef4b1
Testsuite: Review tests that need SCC
jordimassaguerpla Jun 7, 2024
5bde3af
CI: enable os build image test
jordimassaguerpla Apr 5, 2024
9927257
CI: Add non-authorized container registry
jordimassaguerpla May 24, 2024
879cb7f
Testsuite: fix gemfile
jordimassaguerpla Jun 14, 2024
ca5f503
test with jordi's container registry
jordimassaguerpla Jun 20, 2024
076c218
testsuite: fix buildhost tests that require scc
jordimassaguerpla Jun 21, 2024
00a4287
testsuite: fix buildhost tests
jordimassaguerpla Jun 21, 2024
c0e7c4c
CI: buildhost as minion
jordimassaguerpla Jun 25, 2024
02b9941
set ssh later
jordimassaguerpla Jun 25, 2024
dfc327d
CI: add buildhost bootstrap
jordimassaguerpla Jun 25, 2024
7da0c83
CI: add buildhost
jordimassaguerpla Jun 25, 2024
8c7e9a2
CI : fix
jordimassaguerpla Jun 25, 2024
9047cf6
CI: docker in docker
jordimassaguerpla Jun 25, 2024
b0d4788
TEST REVERT ME
jordimassaguerpla Jun 27, 2024
06c1f5b
TEST REVERT ME
jordimassaguerpla Jun 27, 2024
1274b13
Update 21_get_client_logs.sh
jordimassaguerpla Jun 27, 2024
97bcae8
test: skip failing tests
jordimassaguerpla Jun 30, 2024
25cc5a2
CI: skip failing features
jordimassaguerpla Jun 30, 2024
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
9 changes: 6 additions & 3 deletions .github/workflows/acceptance_tests_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ on:
required: true
type: string
env:
UYUNI_PROJECT: uyuni-project
UYUNI_PROJECT: jordimassaguerpla
UYUNI_VERSION: master
NO_AUTH_REGISTRY: no_auth_registry
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
AUTH_REGISTRY: "auth_registry"
AUTH_REGISTRY_CREDENTIALS: "cucutest|cucutest"
jobs:
paths-filter:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -65,8 +68,8 @@ jobs:
run: ./testsuite/podman_runner/01_setup_tmp_dirs.sh
- name: create-podman-network
run: ./testsuite/podman_runner/02_setup_network.sh
- name: start_controller
run: ./testsuite/podman_runner/03_run_controller.sh
- name: start_controller_and_registry_and_buildhost
run: ./testsuite/podman_runner/03_run_controller_and_registry_and_buildhost.sh
- name: create_ssh_conf
run: ./testsuite/podman_runner/04_setup_ssh_controller.sh
- name: install_gems_in_controller
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/acceptance_tests_secondary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
acceptance-tests-secondary:
# Skip running scheduled jobs on forks
if: (github.repository == 'uyuni-project/uyuni' || github.event_name != 'schedule')
uses: ./.github/workflows/acceptance_tests_common.yml
with:
secondary_tests: "18_run_secondary_tests.sh"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/acceptance_tests_secondary_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
acceptance-tests-secondary-parallel:
# Skip running scheduled jobs on forks
if: (github.repository == 'uyuni-project/uyuni' || github.event_name != 'schedule')
uses: ./.github/workflows/acceptance_tests_common.yml
strategy:
fail-fast: false
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/build_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,96 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-registry-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/ci-container-registry

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./testsuite/dockerfiles/container-registry/
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-registry-auth-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/ci-container-registry-auth

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./testsuite/dockerfiles/container-registry-auth/
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-buildhost-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/ci-buildhost

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./testsuite/dockerfiles/buildhost/
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions testsuite/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ gem 'mini_mime', '1.1.2'
gem 'minitest', '~> 5.15.0'
gem 'netrc', '~> 0.11.0'
gem 'nokogiri', '~> 1.12.0'
gem 'parallel', '~> 1.24.0'
gem 'parallel_tests', '~> 3.12.0'
gem 'parallel', '~> 1.24.0'
gem 'pg', '~> 1.4'
Expand Down
17 changes: 17 additions & 0 deletions testsuite/dockerfiles/buildhost/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM opensuse/leap:15.5
RUN zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/images/repo/Uyuni-Server-POOL-x86_64-Media1/ Uyuni-Server-POOL-x86_64 && \
zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/systemsmanagement:Uyuni:Test-Packages:Pool.repo && \
zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable:/openSUSE_Leap_15-Uyuni-Client-Tools/openSUSE_Leap_15.0/ tools_pool_repo && \
zypper ref -f && \
zypper -n install openssh-server openssh-clients hostname iproute2 venv-salt-minion andromeda-dummy milkyway-dummy virgo-dummy openscap-utils openscap-content scap-security-guide gzip udev dmidecode tar \
golang-github-prometheus-prometheus golang-github-prometheus-alertmanager prometheus-blackbox_exporter golang-github-prometheus-node_exporter golang-github-lusitaniae-apache_exporter prometheus-postgres_exporter golang-github-QubitProducts-exporter_exporter golang-github-prometheus-promu ansible && \
zypper clean -a
RUN zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/ test_repo_rpm_pool
# specific to buildhost
RUN zypper ref -f && \
zypper -n install docker docker-buildx \
&& \
zypper clean -a
COPY etc_pam.d_sshd /etc/pam.d/sshd
CMD ssh-keygen -A && /usr/sbin/sshd -De

11 changes: 11 additions & 0 deletions testsuite/dockerfiles/buildhost/etc_pam.d_sshd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#%PAM-1.0
auth requisite pam_nologin.so
auth include common-auth
account requisite pam_nologin.so
account include common-account
password include common-password
session optional pam_loginuid.so
session include common-session
session optional pam_lastlog.so silent noupdate showfailed
session optional pam_keyinit.so force revoke

2 changes: 2 additions & 0 deletions testsuite/dockerfiles/container-registry-auth/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM registry:2

2 changes: 2 additions & 0 deletions testsuite/dockerfiles/container-registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM registry:2

6 changes: 4 additions & 2 deletions testsuite/dockerfiles/opensuse-minion/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM opensuse/leap:15.5
RUN zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/images/repo/Uyuni-Server-POOL-x86_64-Media1/ Uyuni-Server-POOL-x86_64 && \
zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/systemsmanagement:Uyuni:Test-Packages:Pool.repo && \
zypper ref -f && \
zypper -n install openssh-server openssh-clients hostname iproute2 venv-salt-minion andromeda-dummy milkyway-dummy virgo-dummy openscap-utils openscap-content scap-security-guide gzip udev dmidecode tar && \
zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable:/openSUSE_Leap_15-Uyuni-Client-Tools/openSUSE_Leap_15.0/ tools_pool_repo && \
zypper ref -f && \
zypper -n install openssh-server openssh-clients hostname iproute2 venv-salt-minion andromeda-dummy milkyway-dummy virgo-dummy openscap-utils openscap-content scap-security-guide gzip udev dmidecode tar \
golang-github-prometheus-prometheus golang-github-prometheus-alertmanager prometheus-blackbox_exporter golang-github-prometheus-node_exporter golang-github-lusitaniae-apache_exporter prometheus-postgres_exporter golang-github-QubitProducts-exporter_exporter golang-github-prometheus-promu ansible && \
zypper clean -a
RUN zypper -n ar --no-gpgcheck https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/ test_repo_rpm_pool
COPY etc_pam.d_sshd /etc/pam.d/sshd
Expand Down
3 changes: 2 additions & 1 deletion testsuite/dockerfiles/rocky-minion/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM rockylinux:8
COPY uyuni-tools-pool.repo /etc/yum.repos.d
RUN yum -y install openssh-server venv-salt-minion openssh-clients iproute hostname openscap-utils scap-security-guide-redhat udev dmidecode tar
RUN yum -y install openssh-server venv-salt-minion openssh-clients iproute hostname openscap-utils scap-security-guide-redhat udev dmidecode tar \
golang-github-prometheus-node_exporter golang-github-lusitaniae-apache_exporter prometheus-postgres_exporter
COPY test_repo_rpm_pool.repo /etc/yum.repos.d
COPY etc_pam.d_sshd /etc/pam.d/sshd
CMD ssh-keygen -A && /usr/sbin/sshd -De
1 change: 1 addition & 0 deletions testsuite/dockerfiles/server-all-in-one-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN zypper ref && \
cpio \
spacecmd \
expect \
prometheus \
wget && \
zypper addrepo --no-gpgcheck obs://systemsmanagement:Uyuni:Utils systemsmanagement:uyuni:utils && \
zypper -n install obs-to-maven yarn && \
Expand Down
3 changes: 2 additions & 1 deletion testsuite/dockerfiles/ubuntu-minion/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM ubuntu:22.04
RUN echo "deb [trusted=yes] http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable:/Ubuntu2204-Uyuni-Client-Tools/xUbuntu_22.04/ /" > /etc/apt/sources.list.d/uyuni-tools.list
RUN apt-get update && \
apt-get -y install venv-salt-minion openssh-server openssh-client hostname iproute2 libopenscap8 scap-security-guide-ubuntu udev dmidecode tar && \
apt-get -y install venv-salt-minion openssh-server openssh-client hostname iproute2 libopenscap8 scap-security-guide-ubuntu udev dmidecode tar \
prometheus-node-exporter prometheus-apache-exporter prometheus-postgres-exporter prometheus-exporter-exporter prometheus-apache-exporter prometheus-node-exporter && \
apt-get clean
RUN echo "deb [trusted=yes] https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/deb/ /" > /etc/apt/sources.list.d/test_repo_deb_pool.list
RUN mkdir /run/sshd
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2016-2023 SUSE LLC
# Licensed under the terms of the MIT license.

@buildhost
Feature: Bootstrap a build host via the GUI

Scenario: Log in as admin user
Given I am authorized for the "Admin" section

Scenario: Check the new bootstrapped build host in System Overview page
When I follow the left menu "Salt > Keys"
And I accept "build_host" key in the Salt master
And I wait until I do not see "Loading..." text
Then I should see a "accepted" text
When I follow the left menu "Systems > System List > All"
# the build host entitlement adds some extra minutes to apply the salt high-state
And I wait at most 500 seconds until I see the name of "build_host", refreshing the page
Then the Salt master can reach "build_host"

Scenario: Enable "Container Build Host" system type
Given I am on the Systems overview page of this "build_host"
When I follow "Properties" in the content area
And I check "Container Build Host"
And I check "OS Image Build Host"
And I click on "Update Properties"

Scenario: Check that the build host is a build host
Given I am on the Systems overview page of this "build_host"
Then I should see a "[Container Build Host]" text
Then I should see a "[OS Image Build Host]" text

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Feature: Build image with authenticated registry
And I enter URI, username and password for registry
And I click on "create-btn"
Then I wait until I see "registry" text


@scc_credentials
Scenario: Create a profile for the authenticated image store as Docker admin
When I follow the left menu "Images > Profiles"
And I follow "Create"
Expand All @@ -31,6 +32,7 @@ Feature: Build image with authenticated registry
And I click on "create-btn"
Then I wait until I see "auth_registry_profile" text

@scc_credentials
Scenario: Build an image in the authenticated image store
When I follow the left menu "Images > Build"
And I select "auth_registry_profile" from "profileId"
Expand All @@ -46,12 +48,14 @@ Feature: Build image with authenticated registry
Then table row for "auth_registry_profile" should contain "1"
And the list of packages of image "auth_registry_profile" with version "latest" is not empty

@scc_credentials
Scenario: Cleanup: remove Docker profile for the authenticated image store
When I follow the left menu "Images > Profiles"
And I check the row with the "auth_registry_profile" text
And I click on "Delete"
And I click on the red confirmation button
And I should see a "Image profile has been deleted." text
And I wait until no Salt job is running on "build_host"

Scenario: Cleanup: remove authenticated image store
When I follow the left menu "Images > Stores"
Expand All @@ -63,5 +67,3 @@ Feature: Build image with authenticated registry
Scenario: Cleanup: delete registry image
When I delete the image "auth_registry_profile" with version "latest" via API calls

Scenario: Cleanup: Make sure no job is left running on buildhost
When I wait until no Salt job is running on "build_host"
Loading