summaryrefslogtreecommitdiff
path: root/test/apiv2/rest_api/__init__.py
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-11-16 16:11:31 -0700
committerbaude <bbaude@redhat.com>2020-11-23 15:20:39 -0600
commit44da01f45cd941f44d2025864c91b0d2942d2a20 (patch)
treebb37a31fd4dbf0032cdb94c3d2ea1652908be91a /test/apiv2/rest_api/__init__.py
parentcd6c4cb0affdb1e8a647079b2808da6bf833d543 (diff)
downloadpodman-44da01f45cd941f44d2025864c91b0d2942d2a20.tar.gz
podman-44da01f45cd941f44d2025864c91b0d2942d2a20.tar.bz2
podman-44da01f45cd941f44d2025864c91b0d2942d2a20.zip
Refactor compat container create endpoint
* Make endpoint compatibile with docker-py network expectations * Update specgen helper when called from compat endpoint * Update godoc on types * Add test for network/container create using docker-py method * Add syslog logging when DEBUG=1 for tests Fixes #8361 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/apiv2/rest_api/__init__.py')
-rw-r--r--test/apiv2/rest_api/__init__.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/test/apiv2/rest_api/__init__.py b/test/apiv2/rest_api/__init__.py
index 8100a4df5..db0257f03 100644
--- a/test/apiv2/rest_api/__init__.py
+++ b/test/apiv2/rest_api/__init__.py
@@ -16,19 +16,18 @@ class Podman(object):
binary = os.getenv("PODMAN", "bin/podman")
self.cmd = [binary, "--storage-driver=vfs"]
- cgroupfs = os.getenv("CGROUP_MANAGER", "cgroupfs")
+ cgroupfs = os.getenv("CGROUP_MANAGER", "systemd")
self.cmd.append(f"--cgroup-manager={cgroupfs}")
if os.getenv("DEBUG"):
self.cmd.append("--log-level=debug")
+ self.cmd.append("--syslog=true")
self.anchor_directory = tempfile.mkdtemp(prefix="podman_restapi_")
self.cmd.append("--root=" + os.path.join(self.anchor_directory, "crio"))
self.cmd.append("--runroot=" + os.path.join(self.anchor_directory, "crio-run"))
- os.environ["REGISTRIES_CONFIG_PATH"] = os.path.join(
- self.anchor_directory, "registry.conf"
- )
+ os.environ["REGISTRIES_CONFIG_PATH"] = os.path.join(self.anchor_directory, "registry.conf")
p = configparser.ConfigParser()
p.read_dict(
{
@@ -40,14 +39,10 @@ class Podman(object):
with open(os.environ["REGISTRIES_CONFIG_PATH"], "w") as w:
p.write(w)
- os.environ["CNI_CONFIG_PATH"] = os.path.join(
- self.anchor_directory, "cni", "net.d"
- )
+ os.environ["CNI_CONFIG_PATH"] = os.path.join(self.anchor_directory, "cni", "net.d")
os.makedirs(os.environ["CNI_CONFIG_PATH"], exist_ok=True)
self.cmd.append("--cni-config-dir=" + os.environ["CNI_CONFIG_PATH"])
- cni_cfg = os.path.join(
- os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist"
- )
+ cni_cfg = os.path.join(os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist")
# json decoded and encoded to ensure legal json
buf = json.loads(
"""