Skip to content

Commit 87e5513

Browse files
committed
fix bug in validate
1 parent 2047092 commit 87e5513

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/epics_containers_cli/docker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Utility functions for working interacting with docker / podman CLI
33
"""
4-
import os
54
import re
65
import sys
76
from pathlib import Path
@@ -215,7 +214,6 @@ def run_tool(
215214
"""
216215
if entrypoint:
217216
entrypoint = f" --entrypoint {entrypoint}"
218-
os.chdir(Path(__file__).parent)
219217
cwd = Path.cwd().resolve()
220218
mount = f"-w {cwd} -v {cwd}:{cwd} -v /tmp:/tmp"
221219
run_command(

tests/data/local.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ps:
105105
rsp: bl45p-ea-ioc-01%2023.10.9%Up%an image
106106

107107
validate:
108-
- cmd: docker run --rm -w .*epics_containers_cli -v .*epics_containers_cli:.*epics_containers_cli -v \/tmp:\/tmp ghcr.io\/epics-containers\/yajsv -s \/tmp\/ec_tests\/schema.json .*epics-containers-cli\/tests\/data\/iocs\/bl45p-ea-ioc-01\/config\/ioc.yaml
108+
- cmd: docker run --rm -w .* -v .*:.* -v \/tmp:\/tmp ghcr.io\/epics-containers\/yajsv -s \/tmp\/ec_tests\/schema.json .*/bl45p-ea-ioc-01\/config\/ioc.yaml
109109
rsp: True
110110
- cmd: docker manifest inspect ghcr.io\/epics-containers\/ioc-adaravis-linux-runtime:23.9.4
111111
rsp: "OK"

tests/test_local.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
tests for local docker deployment/management commands
33
"""
44

5+
import os
56
import shutil
7+
from pathlib import Path
68

79
from tests.conftest import TMPDIR
810

@@ -67,4 +69,5 @@ def test_ps(mock_run, local):
6769

6870
def test_validate(mock_run, local, data):
6971
mock_run.set_seq(local.setup + local.validate)
72+
os.chdir(Path(__file__).parent)
7073
mock_run.run_cli(f"ioc validate {data / 'iocs/bl45p-ea-ioc-01'}")

0 commit comments

Comments
 (0)