forked from SUSE/BCI-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was based on the init tests, as the pcp container is based on the init container. The docker stuff was removed as only podman suuported. export TARGET=x export BASEURL=registry.suse.de/home/doreilly/branches/suse/sle-15-sp4/update/bci tox -e pcp
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 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,37 @@ | ||
"""This module contains the tests for the pcp container | ||
""" | ||
import pytest | ||
import time | ||
from pytest_container.runtime import LOCALHOST | ||
|
||
from bci_tester.data import PCP_CONTAINER | ||
from bci_tester.runtime_choice import DOCKER_SELECTED | ||
|
||
|
||
@pytest.mark.parametrize("container", [PCP_CONTAINER], indirect=True) | ||
@pytest.mark.skipif(DOCKER_SELECTED, reason="only podman is supported") | ||
def test_systemd_present(container): | ||
"""Check that the pcp daemons are running. | ||
""" | ||
|
||
# pcp needs a little time to initialize | ||
time.sleep(5) | ||
|
||
assert container.connection.run_expect([0], "systemctl status") | ||
assert container.connection.run_expect([0], "systemctl status pmcd") | ||
assert container.connection.run_expect([0], "systemctl status pmlogger") | ||
assert container.connection.run_expect([0], "systemctl status pmproxy") | ||
assert container.connection.run_expect([0], "systemctl status pmie") | ||
|
||
# test call to pmcd | ||
assert container.connection.run_expect([0], "pmprobe -v mem.physmem") | ||
|
||
# test call to pmproxy | ||
if LOCALHOST.exists("curl"): | ||
assert ( | ||
LOCALHOST.run_expect( | ||
[0], | ||
"curl -s http://localhost:44322/metrics?names=mem.physmem", | ||
) | ||
) |
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