Skip to content

Commit

Permalink
shouldn't be needed because docker images but here we are
Browse files Browse the repository at this point in the history
  • Loading branch information
hughesjj committed Sep 25, 2024
1 parent 5d90b53 commit 92b1c1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions internal/buildscripts/packaging/tests/installer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ def test_installer_with_instrumentation_default(distro, arch, method):

print(f"Testing installation on {distro} from {STAGE} stage ...")
dockerfile = get_instrumentation_dockerfile(distro)
print(f"Using dockerfile {dockerfile}")
with run_distro_container(distro, dockerfile=dockerfile, arch=arch, buildargs=buildargs) as container:
copy_file_into_container(container, INSTALLER_PATH, "/test/install.sh")
run_container_cmd(container, f"sh -c 'echo \"# This line should be preserved\" >> {PRELOAD_PATH}'")
Expand All @@ -407,6 +408,12 @@ def test_installer_with_instrumentation_default(distro, arch, method):
# npm installed with node v16 only supports python 3.6+, but these distros only provide python 3.5
# downgrade npm to support python 3.5 in order to build/compile splunk-otel-js
run_container_cmd(container, "bash -l -c 'npm install --global npm@^6'")
if distro in ("opensuse-15", ):
# This really, really shouldn't be needed
run_container_cmd(container, "zypper -n install -y procps")
run_container_cmd(container, "pgrep --help")
run_container_cmd(container, "pgrep -f init")


# set global=true for npm to test that splunk-otel-js is still installed locally
run_container_cmd(container, "sh -l -c 'npm config set global true'")
Expand Down
4 changes: 2 additions & 2 deletions internal/buildscripts/packaging/tests/package_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_package(distro, name, path, arch):
return None


def get_libcap_command(container):
def get_extra_deps_command(container):
if container.exec_run("command -v yum").exit_code == 0:
return "yum install -y libcap"
elif container.exec_run("command -v dnf").exit_code == 0:
Expand Down Expand Up @@ -112,7 +112,7 @@ def test_collector_package_install(distro, arch):
with run_distro_container(distro, arch) as container:
# install setcap dependency
if distro in RPM_DISTROS:
run_container_cmd(container, get_libcap_command(container))
run_container_cmd(container, get_extra_deps_command(container))
else:
run_container_cmd(container, "apt-get update")
run_container_cmd(container, "apt-get install -y libcap2-bin")
Expand Down

0 comments on commit 92b1c1c

Please sign in to comment.