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

tests: remove multihost basic tests #7566

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
117 changes: 1 addition & 116 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,120 +134,6 @@ jobs:
path: |
./sssd/ci-build-debug/*.valgrind.log

multihost:
needs: [prepare, build]
strategy:
fail-fast: false
matrix:
tag: ${{ fromJson(needs.prepare.outputs.matrix).multihost }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout sssd repository
uses: actions/checkout@v3
with:
path: sssd

- name: Setup containers
uses: SSSD/sssd-ci-containers/actions/setup@master
with:
path: sssd-ci-containers
tag: ${{ matrix.tag }}
limit: dns client
override: |
services:
client:
image: ${REGISTRY}/ci-client-devel:${TAG}
shm_size: 4G
tmpfs:
- /dev/shm
volumes:
- ../sssd:/sssd:rw

- name: Build SSSD on the client
uses: SSSD/sssd-ci-containers/actions/exec@master
with:
log-file: multihost-build.log
working-directory: /sssd
script: |
#!/bin/bash
set -ex

./contrib/ci/run --deps-only
autoreconf -if

mkdir -p /dev/shm/sssd
pushd /dev/shm/sssd
/sssd/configure --enable-silent-rules
make rpms

- name: Install SSSD on the client
uses: SSSD/sssd-ci-containers/actions/exec@master
with:
log-file: multihost-install.log
user: root
script: |
#!/bin/bash
set -ex

dnf remove -y --noautoremove sssd\*
dnf install -y /dev/shm/sssd/rpmbuild/RPMS/*/*.rpm
rm -fr /dev/shm/sssd

- name: Install multihost tests dependencies
shell: bash
run: |
set -ex

sudo apt-get update

# Install certutil and dependencies for python-ldap
sudo apt-get install -y libnss3-tools libsasl2-dev python3-dev libldap2-dev libssl-dev

# Virtualenv
pip3 install virtualenv
python3 -m venv .venv
source .venv/bin/activate

# Install multihost tests requirements
pip3 install -r ./sssd/src/tests/multihost/requirements.txt

- name: Create multihost configuration
uses: DamianReeves/write-file-action@41569a7dac64c252caacca7bceefe28b70b38db1
with:
path: mhc.yml
write-mode: overwrite
contents: |
root_password: 'Secret123'
domains:
- name: tier0.tests
type: sssd
hosts:
- name: client
external_hostname: client.test
role: master

- name: Run basic multihost tests
run: |
set -ex -o pipefail

source .venv/bin/activate
export PYTHONPATH="${PYTHONPATH}:$(realpath ./sssd/src/tests/multihost)"
pytest -s --multihost-config=./mhc.yml ./sssd/src/tests/multihost/basic |& tee multihost-pytest.log

- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3
with:
if-no-files-found: ignore
name: ${{ matrix.tag }}-multihost
path: |
sssd/ci-install-deps.log
multihost-build.log
multihost-install.log
multihost-pytest.log

system:
needs: [prepare, build]
strategy:
Expand Down Expand Up @@ -376,12 +262,11 @@ jobs:
name: All tests are successful
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [build, intgcheck, multihost, system]
needs: [build, intgcheck, system]
steps:
- name: Fail on failure
if: |
needs.build.result != 'success'
|| needs.intgcheck.result != 'success'
|| needs.multihost.result != 'success'
|| needs.system.result != 'success'
run: exit 1
11 changes: 0 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5463,17 +5463,6 @@ dist_noinst_DATA += \
contrib/sssd.spec.in \
BUILD.txt \
COPYING \
src/tests/multihost/README.md \
src/tests/multihost/conftest.py \
src/tests/multihost/basic/mhc.yaml \
src/tests/multihost/basic/test_basic.py \
src/tests/multihost/basic/test_config.py \
src/tests/multihost/basic/test_files.py \
src/tests/multihost/basic/test_ifp.py \
src/tests/multihost/basic/test_kcm.py \
src/tests/multihost/basic/test_sssctl_config_check.py \
src/tests/multihost/basic/test_sudo.py \
src/tests/multihost/basic/utils_config.py \
$(NULL)

rpmroot:
Expand Down
49 changes: 1 addition & 48 deletions src/tests/multihost/README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,2 @@
# Instructions on executing tests

Multihost tests uses the `python-multihost` framework to execute test commands
on remote machines. The tests themselves are run locally via pytest.

## Install requirements

```
sudo pip3 install -r src/tests/multihost/requirements.txt
```

You can also install them in virtual environment using the virtualenv command
if you wish.

## Prepare remote machines

Existing tests currently requires only one remote machine where the SSSD version
that you want to test is installed. The machine must be Fedora or RHEL so it can
be correctly provisioned. The **tests will modify the machine** so use something
disposable.

It is recommended to use [sssd-test-suite] project to create such machine. The
multihost tests can run out of the box using [sssd-test-suite] without any
further changes.

[sssd-test-suite]: https://github.com/SSSD/sssd-test-suite

## Prepare multihost configuration

Edit `src/tests/multihost/basic/mhc.yaml`:

```yaml
root_password: 'vagrant' # use remote machine root password
domains:
- name: tier0.tests
type: sssd
hosts:
- name: client
external_hostname: master.client.vm # your machine fully qualified name
role: master
```

Note: You can skip this step if you use machines from sssd-test-suite.

## Run the tests

```
pytest-3 -s --multihost-config=src/tests/multihost/basic/mhc.yaml src/tests/multihost/basic
```
See [tests.sssd.io] https://tests.sssd.io/en/latest/
Loading
Loading