Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ jobs:
- name: "Install packages"
run: |
sudo apt install -y \
libcapstone-dev \
libopenmpi-dev \
ninja-build \
openmpi-bin \
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ RUN apt update \
ca-certificates \
cmake \
git \
libcapstone-dev \
libopenmpi-dev \
ninja-build \
openmpi-bin \
Expand Down Expand Up @@ -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/* \
Expand Down
7 changes: 4 additions & 3 deletions src/posix/syscall_intercept/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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=<INSTALL_DIR>
)
)
4 changes: 3 additions & 1 deletion tests/integration/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <gtest/gtest.h>

#include "capio/syscall.hpp"

char **build_args() {
char **args = (char **) malloc(3 * sizeof(uintptr_t));

Expand Down Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/syscall/src/clone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <fcntl.h>
#include <semaphore.h>
#include <syscall.h>
#include <unistd.h>

constexpr int ARRAY_SIZE = 100;
Expand Down Expand Up @@ -60,15 +61,15 @@ TEST(SystemCallTest, TestThreadCloneProducerConsumer) {
}

TEST(SystemCallTest, TestForkParentChild) {
auto pid = fork();
auto pid = syscall(SYS_fork);
EXPECT_GE(pid, 0);
if (pid == 0) {
exit(EXIT_SUCCESS);
}
}

TEST(SystemCallTest, TestThreadCloneProducerConsumerWithStat) {
constexpr const char *PATHNAME = "test_file.txt";
constexpr const char *PATHNAME = "test_clone.txt";
sem = static_cast<sem_t *>(malloc(sizeof(sem_t)));
EXPECT_EQ(sem_init(sem, 0, 0), 0);
FILE *fp = fopen(PATHNAME, "w+");
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/syscall/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <gtest/gtest.h>

#include "capio/syscall.hpp"

char **build_args() {
char **args = (char **) malloc(3 * sizeof(uintptr_t));

Expand Down Expand Up @@ -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);
Expand Down