diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index b06f95e46..9cc571ced 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -122,7 +122,6 @@ jobs: - name: "Install packages" run: | sudo apt install -y \ - libcapstone-dev \ libopenmpi-dev \ ninja-build \ openmpi-bin \ @@ -164,7 +163,7 @@ jobs: sudo cmake --install ../build --prefix /usr/local - name: "Run tests" id: run-tests - timeout-minutes: 5 + timeout-minutes: 2 env: CAPIO_DIR: ${{ github.workspace }} CAPIO_LOG_LEVEL: -1 diff --git a/Dockerfile b/Dockerfile index 514b36803..44139dbba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,6 @@ RUN apt update \ ca-certificates \ cmake \ git \ - libcapstone-dev \ libopenmpi-dev \ ninja-build \ openmpi-bin \ @@ -39,7 +38,6 @@ ENV LD_LIBRARY_PATH="/usr/local/lib" RUN apt update \ && apt install -y --no-install-recommends \ - libcapstone4 \ openmpi-bin \ openssh-server \ && rm -rf /var/lib/apt/lists/* \ diff --git a/src/posix/syscall_intercept/CMakeLists.txt b/src/posix/syscall_intercept/CMakeLists.txt index 517f76217..351b957ba 100644 --- a/src/posix/syscall_intercept/CMakeLists.txt +++ b/src/posix/syscall_intercept/CMakeLists.txt @@ -14,12 +14,13 @@ include(ExternalProject) # Import external project from git ##################################### ExternalProject_Add(syscall_intercept - GIT_REPOSITORY https://github.com/pmem/syscall_intercept.git - GIT_TAG ca4b13531f883597c2f04a40e095f76f6c3a6d22 + GIT_REPOSITORY https://github.com/alpha-unito/syscall_intercept.git + GIT_TAG 7dbdf6ab9c576f96843ef2553b7efc7d15cf66b4 PREFIX ${CMAKE_CURRENT_BINARY_DIR} CMAKE_ARGS + -DSTATIC_CAPSTONE=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH= -) \ No newline at end of file +) diff --git a/tests/integration/src/main.cpp b/tests/integration/src/main.cpp index 377356755..822801008 100644 --- a/tests/integration/src/main.cpp +++ b/tests/integration/src/main.cpp @@ -1,5 +1,7 @@ #include +#include "capio/syscall.hpp" + char **build_args() { char **args = (char **) malloc(3 * sizeof(uintptr_t)); @@ -59,7 +61,7 @@ class CapioServerEnvironment : public testing::Environment { void SetUp() override { if (server_pid < 0) { ASSERT_NE(std::getenv("CAPIO_DIR"), nullptr); - ASSERT_GE(server_pid = fork(), 0); + ASSERT_GE(server_pid = capio_syscall(SYS_fork), 0); if (server_pid == 0) { execvpe(args[0], args, envp); _exit(127); diff --git a/tests/unit/syscall/src/clone.cpp b/tests/unit/syscall/src/clone.cpp index 0f43d937e..69a0bb06e 100644 --- a/tests/unit/syscall/src/clone.cpp +++ b/tests/unit/syscall/src/clone.cpp @@ -4,6 +4,7 @@ #include #include +#include #include constexpr int ARRAY_SIZE = 100; @@ -60,7 +61,7 @@ TEST(SystemCallTest, TestThreadCloneProducerConsumer) { } TEST(SystemCallTest, TestForkParentChild) { - auto pid = fork(); + auto pid = syscall(SYS_fork); EXPECT_GE(pid, 0); if (pid == 0) { exit(EXIT_SUCCESS); @@ -68,7 +69,7 @@ TEST(SystemCallTest, TestForkParentChild) { } TEST(SystemCallTest, TestThreadCloneProducerConsumerWithStat) { - constexpr const char *PATHNAME = "test_file.txt"; + constexpr const char *PATHNAME = "test_clone.txt"; sem = static_cast(malloc(sizeof(sem_t))); EXPECT_EQ(sem_init(sem, 0, 0), 0); FILE *fp = fopen(PATHNAME, "w+"); diff --git a/tests/unit/syscall/src/main.cpp b/tests/unit/syscall/src/main.cpp index ab6dfde52..cefad0d99 100644 --- a/tests/unit/syscall/src/main.cpp +++ b/tests/unit/syscall/src/main.cpp @@ -1,5 +1,7 @@ #include +#include "capio/syscall.hpp" + char **build_args() { char **args = (char **) malloc(3 * sizeof(uintptr_t)); @@ -59,7 +61,7 @@ class CapioServerEnvironment : public testing::Environment { void SetUp() override { if (server_pid < 0) { ASSERT_NE(std::getenv("CAPIO_DIR"), nullptr); - ASSERT_GE(server_pid = fork(), 0); + ASSERT_GE(server_pid = capio_syscall(SYS_fork), 0); if (server_pid == 0) { execvpe(args[0], args, envp); _exit(127);