Skip to content

Commit 5d01f13

Browse files
authored
Merge pull request #217 from Res260/windowspath
Allow `contentctl test` to work on Windows by fixing a path problem.
2 parents 35fb650 + b8725d6 commit 5d01f13

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/testEndToEnd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
python_version: ["3.11", "3.12"]
15-
operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14"]
15+
operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14", "windows-2022"]
1616
#operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest"]
1717

1818

.github/workflows/test_against_escu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
python_version: ["3.11", "3.12"]
21-
operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14"]
21+
operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14", "windows-2022"]
2222
#operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest"]
2323

2424

contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructureContainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def make_container(self) -> docker.models.resource.Model:
7575
mounts = [
7676
docker.types.Mount(
7777
source=str(self.global_config.getLocalAppDir()),
78-
target=str(self.global_config.getContainerAppDir()),
78+
target=(self.global_config.getContainerAppDir()).as_posix(),
7979
type="bind",
8080
read_only=True,
8181
)

contentctl/objects/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,13 @@ def dumpCICDPlanAndQuit(self, githash: str, detections:List[Detection]):
602602

603603

604604
def getLocalAppDir(self)->pathlib.Path:
605-
#docker really wants abolsute paths
605+
# docker really wants absolute paths
606606
path = self.path / "apps"
607607
return path.absolute()
608608

609609
def getContainerAppDir(self)->pathlib.Path:
610-
#docker really wants abolsute paths
611-
return pathlib.Path("/tmp/apps").absolute()
610+
# docker really wants absolute paths
611+
return pathlib.Path("/tmp/apps")
612612

613613
def enterpriseSecurityInApps(self)->bool:
614614

@@ -740,7 +740,7 @@ def getContainerEnvironmentString(self,stage_file:bool=False, include_custom_app
740740
if path.startswith(SPLUNKBASE_URL):
741741
container_paths.append(path)
742742
else:
743-
container_paths.append(str(self.getContainerAppDir()/pathlib.Path(path).name))
743+
container_paths.append((self.getContainerAppDir()/pathlib.Path(path).name).as_posix())
744744

745745
return ','.join(container_paths)
746746

0 commit comments

Comments
 (0)