aboutsummaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-01 20:48:25 +0200
committerGitHub <noreply@github.com>2022-09-01 20:48:25 +0200
commitd0d1af338a500f2ad00d5ce0638901465602817d (patch)
tree327a081bd2243ffcbdf786a940b1dc82d041bea5 /test/apiv2
parent0085fbb488eec30e71e6cced6a06dbdb134e32a6 (diff)
parent050f3291b9ef8788510b78c543055638275eb20f (diff)
downloadpodman-d0d1af338a500f2ad00d5ce0638901465602817d.tar.gz
podman-d0d1af338a500f2ad00d5ce0638901465602817d.tar.bz2
podman-d0d1af338a500f2ad00d5ce0638901465602817d.zip
Merge pull request #15276 from cdoern/update
implement podman update
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/20-containers.at15
-rw-r--r--test/apiv2/python/rest_api/test_v2_0_0_container.py2
2 files changed, 15 insertions, 2 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 253bb2e45..9ace46b8b 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -547,6 +547,21 @@ t GET libpod/containers/$cname/json 200 \
.ImageName=$IMAGE \
.Name=$cname
+if root; then
+ podman run -dt --name=updateCtr alpine
+ echo '{"Memory":{"Limit":500000}, "CPU":{"Shares":123}}' >${TMPD}/update.json
+ t POST libpod/containers/updateCtr/update ${TMPD}/update.json 201
+
+ # Verify
+ echo '{ "AttachStdout":true,"Cmd":["cat","/sys/fs/cgroup/cpu.weight"]}' >${TMPD}/exec.json
+ t POST containers/updateCtr/exec ${TMPD}/exec.json 201 .Id~[0-9a-f]\\{64\\}
+ eid=$(jq -r '.Id' <<<"$output")
+ # 002 is the byte length
+ t POST exec/$eid/start 200 $'\001\0025'
+
+ podman rm -f updateCtr
+fi
+
rm -rf $TMPD
podman container rm -fa
diff --git a/test/apiv2/python/rest_api/test_v2_0_0_container.py b/test/apiv2/python/rest_api/test_v2_0_0_container.py
index a6cd93a1a..25596a9b7 100644
--- a/test/apiv2/python/rest_api/test_v2_0_0_container.py
+++ b/test/apiv2/python/rest_api/test_v2_0_0_container.py
@@ -359,8 +359,6 @@ class ContainerTestCase(APITestCase):
self.assertEqual(2000, out["HostConfig"]["MemorySwap"])
self.assertEqual(1000, out["HostConfig"]["Memory"])
-
-
def execute_process(cmd):
return subprocess.run(
cmd,