Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
|
e524db436a | |
|
29603f2cd1 | |
|
ae0f1ee8ca | |
|
e767cd8f7d | |
|
40d7bb319f | |
|
3a63473dcc | |
|
803ea74b3b | |
|
1555080e7f |
2
Makefile
2
Makefile
|
@ -8,7 +8,7 @@ DESTDIR ?=
|
||||||
EPOCH_TEST_COMMIT ?= $(shell git merge-base $${DEST_BRANCH:-main} HEAD)
|
EPOCH_TEST_COMMIT ?= $(shell git merge-base $${DEST_BRANCH:-main} HEAD)
|
||||||
HEAD ?= HEAD
|
HEAD ?= HEAD
|
||||||
|
|
||||||
export PODMAN_VERSION ?= "4.8.0"
|
export PODMAN_VERSION ?= "4.8.1"
|
||||||
|
|
||||||
.PHONY: podman
|
.PHONY: podman
|
||||||
podman:
|
podman:
|
||||||
|
|
|
@ -383,22 +383,20 @@ class CreateMixin: # pylint: disable=too-few-public-methods
|
||||||
del args[key]
|
del args[key]
|
||||||
|
|
||||||
# These keywords are not supported for various reasons.
|
# These keywords are not supported for various reasons.
|
||||||
unsupported_keys = set(args.keys()).intersection(
|
unsupported_keys = set(args.keys()).intersection((
|
||||||
(
|
"blkio_weight",
|
||||||
"blkio_weight",
|
"blkio_weight_device", # FIXME In addition to device Major/Minor include path
|
||||||
"blkio_weight_device", # FIXME In addition to device Major/Minor include path
|
"device_cgroup_rules", # FIXME Where to map for Podman API?
|
||||||
"device_cgroup_rules", # FIXME Where to map for Podman API?
|
"device_read_bps", # FIXME In addition to device Major/Minor include path
|
||||||
"device_read_bps", # FIXME In addition to device Major/Minor include path
|
"device_read_iops", # FIXME In addition to device Major/Minor include path
|
||||||
"device_read_iops", # FIXME In addition to device Major/Minor include path
|
"device_requests", # FIXME In addition to device Major/Minor include path
|
||||||
"device_requests", # FIXME In addition to device Major/Minor include path
|
"device_write_bps", # FIXME In addition to device Major/Minor include path
|
||||||
"device_write_bps", # FIXME In addition to device Major/Minor include path
|
"device_write_iops", # FIXME In addition to device Major/Minor include path
|
||||||
"device_write_iops", # FIXME In addition to device Major/Minor include path
|
"domainname",
|
||||||
"domainname",
|
"network_disabled", # FIXME Where to map for Podman API?
|
||||||
"network_disabled", # FIXME Where to map for Podman API?
|
"storage_opt", # FIXME Where to map for Podman API?
|
||||||
"storage_opt", # FIXME Where to map for Podman API?
|
"tmpfs", # FIXME Where to map for Podman API?
|
||||||
"tmpfs", # FIXME Where to map for Podman API?
|
))
|
||||||
)
|
|
||||||
)
|
|
||||||
if len(unsupported_keys) > 0:
|
if len(unsupported_keys) > 0:
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
f"""Keyword(s) '{" ,".join(unsupported_keys)}' are"""
|
f"""Keyword(s) '{" ,".join(unsupported_keys)}' are"""
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
# Do not auto-update these from version.py,
|
# Do not auto-update these from version.py,
|
||||||
# as test code should be changed to reflect changes in Podman API versions
|
# as test code should be changed to reflect changes in Podman API versions
|
||||||
BASE_SOCK = "unix:///run/api.sock"
|
BASE_SOCK = "unix:///run/api.sock"
|
||||||
LIBPOD_URL = "http://%2Frun%2Fapi.sock/v4.8.0/libpod"
|
LIBPOD_URL = "http://%2Frun%2Fapi.sock/v4.8.1/libpod"
|
||||||
COMPATIBLE_URL = "http://%2Frun%2Fapi.sock/v1.40"
|
COMPATIBLE_URL = "http://%2Frun%2Fapi.sock/v1.40"
|
||||||
|
|
|
@ -106,20 +106,14 @@ class ContainersTestCase(unittest.TestCase):
|
||||||
|
|
||||||
@requests_mock.Mocker()
|
@requests_mock.Mocker()
|
||||||
def test_stats(self, mock):
|
def test_stats(self, mock):
|
||||||
stream = [
|
stream = [{
|
||||||
{
|
"Error": None,
|
||||||
"Error": None,
|
"Stats": [{
|
||||||
"Stats": [
|
"ContainerId": "87e1325c82424e49a00abdd4de08009eb76c7de8d228426a9b8af9318ced5ecd",
|
||||||
{
|
"Name": "evil_ptolemy",
|
||||||
"ContainerId": (
|
"CPU": 1000.0,
|
||||||
"87e1325c82424e49a00abdd4de08009eb76c7de8d228426a9b8af9318ced5ecd"
|
}],
|
||||||
),
|
}]
|
||||||
"Name": "evil_ptolemy",
|
|
||||||
"CPU": 1000.0,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}
|
|
||||||
]
|
|
||||||
buffer = io.StringIO()
|
buffer = io.StringIO()
|
||||||
for entry in stream:
|
for entry in stream:
|
||||||
buffer.write(json.JSONEncoder().encode(entry))
|
buffer.write(json.JSONEncoder().encode(entry))
|
||||||
|
@ -413,28 +407,23 @@ class ContainersTestCase(unittest.TestCase):
|
||||||
|
|
||||||
@requests_mock.Mocker()
|
@requests_mock.Mocker()
|
||||||
def test_top_with_streaming(self, mock):
|
def test_top_with_streaming(self, mock):
|
||||||
stream = [
|
stream = [{
|
||||||
{
|
"Processes": [
|
||||||
"Processes": [
|
[
|
||||||
[
|
'jhonce',
|
||||||
'jhonce',
|
'2417',
|
||||||
'2417',
|
'2274',
|
||||||
'2274',
|
'0',
|
||||||
'0',
|
'Mar01',
|
||||||
'Mar01',
|
'?',
|
||||||
'?',
|
'00:00:01',
|
||||||
'00:00:01',
|
'/usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c "/usr/bin/gnome-session"',
|
||||||
(
|
|
||||||
'/usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c'
|
|
||||||
' "/usr/bin/gnome-session"'
|
|
||||||
),
|
|
||||||
],
|
|
||||||
['jhonce', '5544', '3522', '0', 'Mar01', 'pts/1', '00:00:02', '-bash'],
|
|
||||||
['jhonce', '6140', '3522', '0', 'Mar01', 'pts/2', '00:00:00', '-bash'],
|
|
||||||
],
|
],
|
||||||
"Titles": ["UID", "PID", "PPID", "C", "STIME", "TTY", "TIME CMD"],
|
['jhonce', '5544', '3522', '0', 'Mar01', 'pts/1', '00:00:02', '-bash'],
|
||||||
}
|
['jhonce', '6140', '3522', '0', 'Mar01', 'pts/2', '00:00:00', '-bash'],
|
||||||
]
|
],
|
||||||
|
"Titles": ["UID", "PID", "PPID", "C", "STIME", "TTY", "TIME CMD"],
|
||||||
|
}]
|
||||||
|
|
||||||
buffer = io.StringIO()
|
buffer = io.StringIO()
|
||||||
for entry in stream:
|
for entry in stream:
|
||||||
|
|
|
@ -22,23 +22,21 @@ class EventsManagerTestCase(unittest.TestCase):
|
||||||
|
|
||||||
@requests_mock.Mocker()
|
@requests_mock.Mocker()
|
||||||
def test_list(self, mock):
|
def test_list(self, mock):
|
||||||
stream = [
|
stream = [{
|
||||||
{
|
"Type": "pod",
|
||||||
"Type": "pod",
|
"Action": "create",
|
||||||
"Action": "create",
|
"Actor": {
|
||||||
"Actor": {
|
"ID": "",
|
||||||
"ID": "",
|
"Attributes": {
|
||||||
"Attributes": {
|
"image": "",
|
||||||
"image": "",
|
"name": "",
|
||||||
"name": "",
|
"containerExitCode": 0,
|
||||||
"containerExitCode": 0,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
"Scope": "local",
|
},
|
||||||
"Time": 1615845480,
|
"Scope": "local",
|
||||||
"TimeNano": 1615845480,
|
"Time": 1615845480,
|
||||||
}
|
"TimeNano": 1615845480,
|
||||||
]
|
}]
|
||||||
buffer = io.StringIO()
|
buffer = io.StringIO()
|
||||||
for item in stream:
|
for item in stream:
|
||||||
buffer.write(json.JSONEncoder().encode(item))
|
buffer.write(json.JSONEncoder().encode(item))
|
||||||
|
|
|
@ -51,16 +51,14 @@ class ImageTestCase(unittest.TestCase):
|
||||||
adapter = mock.get(
|
adapter = mock.get(
|
||||||
tests.LIBPOD_URL
|
tests.LIBPOD_URL
|
||||||
+ "/images/326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab/history",
|
+ "/images/326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab/history",
|
||||||
json=[
|
json=[{
|
||||||
{
|
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
|
||||||
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
|
"Comment": "",
|
||||||
"Comment": "",
|
"Created": 1614208404,
|
||||||
"Created": 1614208404,
|
"CreatedBy": "2021-02-24T23:13:24+00:00",
|
||||||
"CreatedBy": "2021-02-24T23:13:24+00:00",
|
"Tags": ["latest"],
|
||||||
"Tags": ["latest"],
|
"Size": 1024,
|
||||||
"Size": 1024,
|
}],
|
||||||
}
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
image = Image(attrs=FIRST_IMAGE, client=self.client.api)
|
image = Image(attrs=FIRST_IMAGE, client=self.client.api)
|
||||||
|
|
||||||
|
|
|
@ -156,13 +156,11 @@ class ImagesManagerTestCase(unittest.TestCase):
|
||||||
"""Unit test Images prune()."""
|
"""Unit test Images prune()."""
|
||||||
mock.post(
|
mock.post(
|
||||||
tests.LIBPOD_URL + "/images/prune",
|
tests.LIBPOD_URL + "/images/prune",
|
||||||
json=[
|
json=[{
|
||||||
{
|
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
|
||||||
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
|
"Err": None,
|
||||||
"Err": None,
|
"Size": 1024,
|
||||||
"Size": 1024,
|
}],
|
||||||
}
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
results = self.client.images.prune()
|
results = self.client.images.prune()
|
||||||
|
@ -212,11 +210,9 @@ class ImagesManagerTestCase(unittest.TestCase):
|
||||||
"""Unit test to report error carried in response body."""
|
"""Unit test to report error carried in response body."""
|
||||||
mock.post(
|
mock.post(
|
||||||
tests.LIBPOD_URL + "/images/prune",
|
tests.LIBPOD_URL + "/images/prune",
|
||||||
json=[
|
json=[{
|
||||||
{
|
"Err": "Test prune failure in response body.",
|
||||||
"Err": "Test prune failure in response body.",
|
}],
|
||||||
}
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
with self.assertRaises(APIError) as e:
|
with self.assertRaises(APIError) as e:
|
||||||
|
|
|
@ -34,16 +34,14 @@ FIRST_NETWORK_LIBPOD = {
|
||||||
"driver": "bridge",
|
"driver": "bridge",
|
||||||
"network_interface": "libpod_veth0",
|
"network_interface": "libpod_veth0",
|
||||||
"created": "2022-01-28T09:18:37.491308364-07:00",
|
"created": "2022-01-28T09:18:37.491308364-07:00",
|
||||||
"subnets": [
|
"subnets": [{
|
||||||
{
|
"subnet": "10.11.12.0/24",
|
||||||
"subnet": "10.11.12.0/24",
|
"gateway": "10.11.12.1",
|
||||||
"gateway": "10.11.12.1",
|
"lease_range": {
|
||||||
"lease_range": {
|
"start_ip": "10.11.12.1",
|
||||||
"start_ip": "10.11.12.1",
|
"end_ip": "10.11.12.63",
|
||||||
"end_ip": "10.11.12.63",
|
},
|
||||||
},
|
}],
|
||||||
}
|
|
||||||
],
|
|
||||||
"ipv6_enabled": False,
|
"ipv6_enabled": False,
|
||||||
"internal": False,
|
"internal": False,
|
||||||
"dns_enabled": False,
|
"dns_enabled": False,
|
||||||
|
|
|
@ -56,16 +56,14 @@ FIRST_NETWORK_LIBPOD = {
|
||||||
"driver": "bridge",
|
"driver": "bridge",
|
||||||
"network_interface": "libpod_veth0",
|
"network_interface": "libpod_veth0",
|
||||||
"created": "2022-01-28T09:18:37.491308364-07:00",
|
"created": "2022-01-28T09:18:37.491308364-07:00",
|
||||||
"subnets": [
|
"subnets": [{
|
||||||
{
|
"subnet": "10.11.12.0/24",
|
||||||
"subnet": "10.11.12.0/24",
|
"gateway": "10.11.12.1",
|
||||||
"gateway": "10.11.12.1",
|
"lease_range": {
|
||||||
"lease_range": {
|
"start_ip": "10.11.12.1",
|
||||||
"start_ip": "10.11.12.1",
|
"end_ip": "10.11.12.63",
|
||||||
"end_ip": "10.11.12.63",
|
},
|
||||||
},
|
}],
|
||||||
}
|
|
||||||
],
|
|
||||||
"ipv6_enabled": False,
|
"ipv6_enabled": False,
|
||||||
"internal": False,
|
"internal": False,
|
||||||
"dns_enabled": False,
|
"dns_enabled": False,
|
||||||
|
@ -80,16 +78,14 @@ SECOND_NETWORK_LIBPOD = {
|
||||||
"created": "2021-03-01T09:18:37.491308364-07:00",
|
"created": "2021-03-01T09:18:37.491308364-07:00",
|
||||||
"driver": "bridge",
|
"driver": "bridge",
|
||||||
"network_interface": "libpod_veth1",
|
"network_interface": "libpod_veth1",
|
||||||
"subnets": [
|
"subnets": [{
|
||||||
{
|
"subnet": "10.11.12.0/24",
|
||||||
"subnet": "10.11.12.0/24",
|
"gateway": "10.11.12.1",
|
||||||
"gateway": "10.11.12.1",
|
"lease_range": {
|
||||||
"lease_range": {
|
"start_ip": "10.11.12.1",
|
||||||
"start_ip": "10.11.12.1",
|
"end_ip": "10.11.12.63",
|
||||||
"end_ip": "10.11.12.63",
|
},
|
||||||
},
|
}],
|
||||||
}
|
|
||||||
],
|
|
||||||
"ipv6_enabled": False,
|
"ipv6_enabled": False,
|
||||||
"internal": False,
|
"internal": False,
|
||||||
"dns_enabled": False,
|
"dns_enabled": False,
|
||||||
|
|
|
@ -194,34 +194,30 @@ class PodsManagerTestCase(unittest.TestCase):
|
||||||
@requests_mock.Mocker()
|
@requests_mock.Mocker()
|
||||||
def test_top_with_streaming(self, mock):
|
def test_top_with_streaming(self, mock):
|
||||||
stream = [
|
stream = [
|
||||||
[
|
[{
|
||||||
{
|
'CPU': '2.53%',
|
||||||
'CPU': '2.53%',
|
'MemUsage': '49.15kB / 16.71GB',
|
||||||
'MemUsage': '49.15kB / 16.71GB',
|
'MemUsageBytes': '48KiB / 15.57GiB',
|
||||||
'MemUsageBytes': '48KiB / 15.57GiB',
|
'Mem': '0.00%',
|
||||||
'Mem': '0.00%',
|
'NetIO': '7.638kB / 430B',
|
||||||
'NetIO': '7.638kB / 430B',
|
'BlockIO': '-- / --',
|
||||||
'BlockIO': '-- / --',
|
'PIDS': '1',
|
||||||
'PIDS': '1',
|
'Pod': '1c948ab42339',
|
||||||
'Pod': '1c948ab42339',
|
'CID': 'd999c49a7b6c',
|
||||||
'CID': 'd999c49a7b6c',
|
'Name': '1c948ab42339-infra',
|
||||||
'Name': '1c948ab42339-infra',
|
}],
|
||||||
}
|
[{
|
||||||
],
|
'CPU': '1.46%',
|
||||||
[
|
'MemUsage': '57.23B / 16.71GB',
|
||||||
{
|
'MemUsageBytes': '48KiB / 15.57GiB',
|
||||||
'CPU': '1.46%',
|
'Mem': '0.00%',
|
||||||
'MemUsage': '57.23B / 16.71GB',
|
'NetIO': '7.638kB / 430B',
|
||||||
'MemUsageBytes': '48KiB / 15.57GiB',
|
'BlockIO': '-- / --',
|
||||||
'Mem': '0.00%',
|
'PIDS': '1',
|
||||||
'NetIO': '7.638kB / 430B',
|
'Pod': '1c948ab42339',
|
||||||
'BlockIO': '-- / --',
|
'CID': 'd999c49a7b6c',
|
||||||
'PIDS': '1',
|
'Name': '1c948ab42339-infra',
|
||||||
'Pod': '1c948ab42339',
|
}],
|
||||||
'CID': 'd999c49a7b6c',
|
|
||||||
'Name': '1c948ab42339-infra',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
|
|
||||||
buffer = io.StringIO()
|
buffer = io.StringIO()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
"""Version of PodmanPy."""
|
"""Version of PodmanPy."""
|
||||||
|
|
||||||
__version__ = "4.8.0"
|
__version__ = "4.8.1"
|
||||||
__compatible_version__ = "1.40"
|
__compatible_version__ = "1.40"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = podman
|
name = podman
|
||||||
version = 4.8.0
|
version = 4.8.1
|
||||||
author = Brent Baude, Jhon Honce
|
author = Brent Baude, Jhon Honce
|
||||||
author_email = jhonce@redhat.com
|
author_email = jhonce@redhat.com
|
||||||
description = Bindings for Podman RESTful API
|
description = Bindings for Podman RESTful API
|
||||||
|
@ -38,6 +38,7 @@ install_requires =
|
||||||
requests >=2.24
|
requests >=2.24
|
||||||
tomli>=1.2.3; python_version<'3.11'
|
tomli>=1.2.3; python_version<'3.11'
|
||||||
urllib3
|
urllib3
|
||||||
|
rich >= 12.5.1
|
||||||
|
|
||||||
# typing_extensions are included for RHEL 8.5
|
# typing_extensions are included for RHEL 8.5
|
||||||
# typing_extensions;python_version<'3.8'
|
# typing_extensions;python_version<'3.8'
|
||||||
|
|
Loading…
Reference in New Issue