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)
|
||||
HEAD ?= HEAD
|
||||
|
||||
export PODMAN_VERSION ?= "4.8.0"
|
||||
export PODMAN_VERSION ?= "4.8.1"
|
||||
|
||||
.PHONY: podman
|
||||
podman:
|
||||
|
|
|
@ -383,8 +383,7 @@ class CreateMixin: # pylint: disable=too-few-public-methods
|
|||
del args[key]
|
||||
|
||||
# These keywords are not supported for various reasons.
|
||||
unsupported_keys = set(args.keys()).intersection(
|
||||
(
|
||||
unsupported_keys = set(args.keys()).intersection((
|
||||
"blkio_weight",
|
||||
"blkio_weight_device", # FIXME In addition to device Major/Minor include path
|
||||
"device_cgroup_rules", # FIXME Where to map for Podman API?
|
||||
|
@ -397,8 +396,7 @@ class CreateMixin: # pylint: disable=too-few-public-methods
|
|||
"network_disabled", # FIXME Where to map for Podman API?
|
||||
"storage_opt", # FIXME Where to map for Podman API?
|
||||
"tmpfs", # FIXME Where to map for Podman API?
|
||||
)
|
||||
)
|
||||
))
|
||||
if len(unsupported_keys) > 0:
|
||||
raise TypeError(
|
||||
f"""Keyword(s) '{" ,".join(unsupported_keys)}' are"""
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
# Do not auto-update these from version.py,
|
||||
# as test code should be changed to reflect changes in Podman API versions
|
||||
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"
|
||||
|
|
|
@ -106,20 +106,14 @@ class ContainersTestCase(unittest.TestCase):
|
|||
|
||||
@requests_mock.Mocker()
|
||||
def test_stats(self, mock):
|
||||
stream = [
|
||||
{
|
||||
stream = [{
|
||||
"Error": None,
|
||||
"Stats": [
|
||||
{
|
||||
"ContainerId": (
|
||||
"87e1325c82424e49a00abdd4de08009eb76c7de8d228426a9b8af9318ced5ecd"
|
||||
),
|
||||
"Stats": [{
|
||||
"ContainerId": "87e1325c82424e49a00abdd4de08009eb76c7de8d228426a9b8af9318ced5ecd",
|
||||
"Name": "evil_ptolemy",
|
||||
"CPU": 1000.0,
|
||||
}
|
||||
],
|
||||
}
|
||||
]
|
||||
}],
|
||||
}]
|
||||
buffer = io.StringIO()
|
||||
for entry in stream:
|
||||
buffer.write(json.JSONEncoder().encode(entry))
|
||||
|
@ -413,8 +407,7 @@ class ContainersTestCase(unittest.TestCase):
|
|||
|
||||
@requests_mock.Mocker()
|
||||
def test_top_with_streaming(self, mock):
|
||||
stream = [
|
||||
{
|
||||
stream = [{
|
||||
"Processes": [
|
||||
[
|
||||
'jhonce',
|
||||
|
@ -424,17 +417,13 @@ class ContainersTestCase(unittest.TestCase):
|
|||
'Mar01',
|
||||
'?',
|
||||
'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"],
|
||||
}
|
||||
]
|
||||
}]
|
||||
|
||||
buffer = io.StringIO()
|
||||
for entry in stream:
|
||||
|
|
|
@ -22,8 +22,7 @@ class EventsManagerTestCase(unittest.TestCase):
|
|||
|
||||
@requests_mock.Mocker()
|
||||
def test_list(self, mock):
|
||||
stream = [
|
||||
{
|
||||
stream = [{
|
||||
"Type": "pod",
|
||||
"Action": "create",
|
||||
"Actor": {
|
||||
|
@ -37,8 +36,7 @@ class EventsManagerTestCase(unittest.TestCase):
|
|||
"Scope": "local",
|
||||
"Time": 1615845480,
|
||||
"TimeNano": 1615845480,
|
||||
}
|
||||
]
|
||||
}]
|
||||
buffer = io.StringIO()
|
||||
for item in stream:
|
||||
buffer.write(json.JSONEncoder().encode(item))
|
||||
|
|
|
@ -51,16 +51,14 @@ class ImageTestCase(unittest.TestCase):
|
|||
adapter = mock.get(
|
||||
tests.LIBPOD_URL
|
||||
+ "/images/326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab/history",
|
||||
json=[
|
||||
{
|
||||
json=[{
|
||||
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
|
||||
"Comment": "",
|
||||
"Created": 1614208404,
|
||||
"CreatedBy": "2021-02-24T23:13:24+00:00",
|
||||
"Tags": ["latest"],
|
||||
"Size": 1024,
|
||||
}
|
||||
],
|
||||
}],
|
||||
)
|
||||
image = Image(attrs=FIRST_IMAGE, client=self.client.api)
|
||||
|
||||
|
|
|
@ -156,13 +156,11 @@ class ImagesManagerTestCase(unittest.TestCase):
|
|||
"""Unit test Images prune()."""
|
||||
mock.post(
|
||||
tests.LIBPOD_URL + "/images/prune",
|
||||
json=[
|
||||
{
|
||||
json=[{
|
||||
"Id": "326dd9d7add24646a325e8eaa82125294027db2332e49c5828d96312c5d773ab",
|
||||
"Err": None,
|
||||
"Size": 1024,
|
||||
}
|
||||
],
|
||||
}],
|
||||
)
|
||||
|
||||
results = self.client.images.prune()
|
||||
|
@ -212,11 +210,9 @@ class ImagesManagerTestCase(unittest.TestCase):
|
|||
"""Unit test to report error carried in response body."""
|
||||
mock.post(
|
||||
tests.LIBPOD_URL + "/images/prune",
|
||||
json=[
|
||||
{
|
||||
json=[{
|
||||
"Err": "Test prune failure in response body.",
|
||||
}
|
||||
],
|
||||
}],
|
||||
)
|
||||
|
||||
with self.assertRaises(APIError) as e:
|
||||
|
|
|
@ -34,16 +34,14 @@ FIRST_NETWORK_LIBPOD = {
|
|||
"driver": "bridge",
|
||||
"network_interface": "libpod_veth0",
|
||||
"created": "2022-01-28T09:18:37.491308364-07:00",
|
||||
"subnets": [
|
||||
{
|
||||
"subnets": [{
|
||||
"subnet": "10.11.12.0/24",
|
||||
"gateway": "10.11.12.1",
|
||||
"lease_range": {
|
||||
"start_ip": "10.11.12.1",
|
||||
"end_ip": "10.11.12.63",
|
||||
},
|
||||
}
|
||||
],
|
||||
}],
|
||||
"ipv6_enabled": False,
|
||||
"internal": False,
|
||||
"dns_enabled": False,
|
||||
|
|
|
@ -56,16 +56,14 @@ FIRST_NETWORK_LIBPOD = {
|
|||
"driver": "bridge",
|
||||
"network_interface": "libpod_veth0",
|
||||
"created": "2022-01-28T09:18:37.491308364-07:00",
|
||||
"subnets": [
|
||||
{
|
||||
"subnets": [{
|
||||
"subnet": "10.11.12.0/24",
|
||||
"gateway": "10.11.12.1",
|
||||
"lease_range": {
|
||||
"start_ip": "10.11.12.1",
|
||||
"end_ip": "10.11.12.63",
|
||||
},
|
||||
}
|
||||
],
|
||||
}],
|
||||
"ipv6_enabled": False,
|
||||
"internal": False,
|
||||
"dns_enabled": False,
|
||||
|
@ -80,16 +78,14 @@ SECOND_NETWORK_LIBPOD = {
|
|||
"created": "2021-03-01T09:18:37.491308364-07:00",
|
||||
"driver": "bridge",
|
||||
"network_interface": "libpod_veth1",
|
||||
"subnets": [
|
||||
{
|
||||
"subnets": [{
|
||||
"subnet": "10.11.12.0/24",
|
||||
"gateway": "10.11.12.1",
|
||||
"lease_range": {
|
||||
"start_ip": "10.11.12.1",
|
||||
"end_ip": "10.11.12.63",
|
||||
},
|
||||
}
|
||||
],
|
||||
}],
|
||||
"ipv6_enabled": False,
|
||||
"internal": False,
|
||||
"dns_enabled": False,
|
||||
|
|
|
@ -194,8 +194,7 @@ class PodsManagerTestCase(unittest.TestCase):
|
|||
@requests_mock.Mocker()
|
||||
def test_top_with_streaming(self, mock):
|
||||
stream = [
|
||||
[
|
||||
{
|
||||
[{
|
||||
'CPU': '2.53%',
|
||||
'MemUsage': '49.15kB / 16.71GB',
|
||||
'MemUsageBytes': '48KiB / 15.57GiB',
|
||||
|
@ -206,10 +205,8 @@ class PodsManagerTestCase(unittest.TestCase):
|
|||
'Pod': '1c948ab42339',
|
||||
'CID': 'd999c49a7b6c',
|
||||
'Name': '1c948ab42339-infra',
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
}],
|
||||
[{
|
||||
'CPU': '1.46%',
|
||||
'MemUsage': '57.23B / 16.71GB',
|
||||
'MemUsageBytes': '48KiB / 15.57GiB',
|
||||
|
@ -220,8 +217,7 @@ class PodsManagerTestCase(unittest.TestCase):
|
|||
'Pod': '1c948ab42339',
|
||||
'CID': 'd999c49a7b6c',
|
||||
'Name': '1c948ab42339-infra',
|
||||
}
|
||||
],
|
||||
}],
|
||||
]
|
||||
|
||||
buffer = io.StringIO()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""Version of PodmanPy."""
|
||||
|
||||
__version__ = "4.8.0"
|
||||
__version__ = "4.8.1"
|
||||
__compatible_version__ = "1.40"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[metadata]
|
||||
name = podman
|
||||
version = 4.8.0
|
||||
version = 4.8.1
|
||||
author = Brent Baude, Jhon Honce
|
||||
author_email = jhonce@redhat.com
|
||||
description = Bindings for Podman RESTful API
|
||||
|
@ -38,6 +38,7 @@ install_requires =
|
|||
requests >=2.24
|
||||
tomli>=1.2.3; python_version<'3.11'
|
||||
urllib3
|
||||
rich >= 12.5.1
|
||||
|
||||
# typing_extensions are included for RHEL 8.5
|
||||
# typing_extensions;python_version<'3.8'
|
||||
|
|
Loading…
Reference in New Issue