Skip to content

Commit

Permalink
Set --systemd always for podman client containers
Browse files Browse the repository at this point in the history
The default for the --systemd option in podman is to use the default
CMD for a container to detect whether systemd should be set to true.
From testing this appears to be buggy and not to always work. By setting
--systemd to always we force podman to run with systemd working
inside the containers and avoid any potential issues with automatic
detection.
  • Loading branch information
ehelms committed Mar 29, 2021
1 parent 28fbc0a commit 98a7205
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,40 @@ The set of clients to test must also be specified in `variables.json`:
```
"clients": [
"smoker-test/centos8:nightly",
"smoker-test/centos7:nightly",
"smoker-test/centos7:nightly"
]
```

By default, the client tests support testing the EL7 and EL8 images due to the complexities of rootless containers with systemd.

### EL6 Client Tests

The EL6 client container based tests can be ran when using an EL7 host due to the complexities of running rootless containers with podman and systemd. To test this manully, assuming you have spun up an EL7 machine with podman present and smoker checked out, build the images:

```
./build_images.sh nightly
```

Now update the variables.json to include only the EL6 container:

```
"clients": [
"smoker-test/centos6:nightly"
]
```

Additionally, due to how logging is handled, inside `tests/test_content_client.py`, you'll need to update the podman run command:

```
container_id = subprocess.check_output([
'podman',
'run',
'--systemd',
'always',
'--volume',
'/dev/log:/dev/log',
'--detach',
'--tty',
request.param
]).decode().strip()
```
4 changes: 2 additions & 2 deletions tests/test_content_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def katello_client(request, entities, registration_hostname):
container_id = subprocess.check_output([
'podman',
'run',
'--volume',
'/dev/log:/dev/log',
'--systemd',
'always',
'--detach',
'--tty',
request.param
Expand Down
10 changes: 10 additions & 0 deletions tests/test_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pyest


def test_ping(api):
ping = api.resource('ping').call('ping')['results']

assert ping['foreman']['database']['active']

if 'katello' in ping:
assert ping['katello']['status'] == 'ok'
3 changes: 1 addition & 2 deletions variables.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"password": "changeme",
"clients": [
"smoker-test/centos8:nightly",
"smoker-test/centos7:nightly",
"smoker-test/centos6:nightly"
"smoker-test/centos7:nightly"
]
}

0 comments on commit 98a7205

Please sign in to comment.