Commit 186ad3f8 authored by Ramon Nou's avatar Ramon Nou
Browse files

Merge branch 'rnou/java-testing' into 'master'

Rnou/java testing

Closes #362

Closes #362

See merge request !257
parents f3ee9508 f84ddaa4
Loading
Loading
Loading
Loading
Loading
+83 −1
Original line number Diff line number Diff line
@@ -345,6 +345,88 @@ gkfs:app:
      junit: ${BUILD_PATH}/tests/apps/report.xml


## == java tests for gkfs ==================
gkfs:java:
  stage: test
  image: gekkofs/java:0.9.5
  needs: ['gkfs']
  script:
    ## Add path to mkfs.kreon
    - export PATH=${PATH}:/usr/local/bin
    ## run actual tests
    - cd ${CI_PROJECT_DIR}
    - ctest --test-dir ${BUILD_PATH}
          -j 1
          -L java::all
          -VV
          --output-junit ${BUILD_PATH}/tests/java/report.xml

    ## capture coverage information for this test and write it to
    ## $COVERAGE_PATH/java.info
    - cd ${CI_PROJECT_DIR}
        # use ccache
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cmake --preset ci-coverage
          -DCOVERAGE_OUTPUT_DIR=${COVERAGE_PATH}
          -DCOVERAGE_CAPTURE_TRACEFILE=${COVERAGE_PATH}/java.info
          -DARGS_EXCLUDE_DIRECTORIES=${CI_PROJECT_DIR}/external
    ## Since the pipeline recreates the source tree, the access times for .gcno
    ## files are newer than those of .gcda files. This makes gcov emit a
    ## warning for each file which slows it down. Updating the timestamps
    ## avoids this
    - find ${BUILD_PATH} -name "*.gcno" -exec touch {} \;
    - cmake --build ${BUILD_PATH} --target coverage-capture

  artifacts:
    expire_in: 1 day
    paths:
      - ${BUILD_PATH}
    reports:
      junit: ${BUILD_PATH}/tests/java/report.xml


## == python tests for gkfs ==================
gkfs:python:
  stage: test
  image: gekkofs/testing:0.9.5
  needs: ['gkfs']
  script:
    ## Add path to mkfs.kreon
    - export PATH=${PATH}:/usr/local/bin
    ## run actual tests
    - cd ${CI_PROJECT_DIR}
    - ctest --test-dir ${BUILD_PATH}
          -j 1
          -L python::all
          -VV
          --output-junit ${BUILD_PATH}/tests/python/report.xml

    ## capture coverage information for this test and write it to
    ## $COVERAGE_PATH/java.info
    - cd ${CI_PROJECT_DIR}
        # use ccache
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cmake --preset ci-coverage
          -DCOVERAGE_OUTPUT_DIR=${COVERAGE_PATH}
          -DCOVERAGE_CAPTURE_TRACEFILE=${COVERAGE_PATH}/python.info
          -DARGS_EXCLUDE_DIRECTORIES=${CI_PROJECT_DIR}/external
    ## Since the pipeline recreates the source tree, the access times for .gcno
    ## files are newer than those of .gcda files. This makes gcov emit a
    ## warning for each file which slows it down. Updating the timestamps
    ## avoids this
    - find ${BUILD_PATH} -name "*.gcno" -exec touch {} \;
    - cmake --build ${BUILD_PATH} --target coverage-capture

  artifacts:
    expire_in: 1 day
    paths:
      - ${BUILD_PATH}
    reports:
      junit: ${BUILD_PATH}/tests/python/report.xml


################################################################################
## Generation of documentation
################################################################################
@@ -416,7 +498,7 @@ coverage:
  stage: report
  image: gekkofs/testing:0.9.5
  #needs: [ 'coverage:baseline', 'gkfs:integration', 'gkfs:unit', 'gkfwd:integration']
  needs: [ 'coverage:baseline', 'gkfs:allintegration', 'gkfs:unit', 'gkfs:app']
  needs: [ 'coverage:baseline', 'gkfs:allintegration', 'gkfs:unit', 'gkfs:app', 'gkfs:java', 'gkfs:python' ]
  script:
      # use ccache
    - ccache --zero-stats
+9 −1
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
    - Use PROTECT_FILES_GENERATOR=1 and PROTECT_FILES_CONSUMER=1 to enable. Generator, creates transparent .lockgekko files that blocks the open (for some seconds) of any consumer. Multiple opens / closes for generator are managed.
  - Basic mmap support ([!247](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/245))
  - LIBC interception support, with extra tests ([!202](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/202))
  - Fixes for vfork, java and python ([!257](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/257))
    - Adds two new testing stages, java and python.

### Changed 
  - Tests check ret for -1 instead of 10000 fd ([!320](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/320))
@@ -41,6 +43,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
  - Java with syscalls deadlocks as it try to resolve paths (malloc) in a locking situation ([!255](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/255))
    - It also solves flock missing implementation when we are ouside gekkofs
    - Some features in syscall_intercept still hangs if we do not lower the debug information.
  - Fixes for vfork, java and python ([!257](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/257))
    - execve and chdir failed as calling the server for get_metadata fails, disabled chdir checks (GekkoFS)
    - execve set reentrant_guard as true, so once it returns (vfork) the parent had syscall disabled.
    - debug should be still set to debug level on syscall for vfork.
    - In MN5 gkfs_libc.hpp needs to have the libc signatures.


## [0.9.4] - 2025-03
### New
+10 −0
Original line number Diff line number Diff line
FROM gekkofs/testing:0.9.5

LABEL Description="Debian-based environment to run java"
ARG DEBIAN_FRONTEND=noninteractive

# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    openjdk-25-jdk-headless \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean 
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
.PHONY: all

amd64:
	docker build --platform amd64 -t gekkofs/java:0.9.5 .

aarch64:
	docker build --platform aarch64 -t gekkofs/java:0.9.5 .

all:
	docker build -t gekkofs/java:0.9.5 .
+0 −28
Original line number Diff line number Diff line
@@ -605,11 +605,6 @@ DLSYM_WRAPPER(int, dup2, (int fd, int fd2), (fd, fd2), "dup2")
DLSYM_WRAPPER(int, dup3, (int fd, int fd2, int flags), (fd, fd2, flags), "dup3")
static int (*real_fcntl)(int fd, int cmd,
                         ...) = nullptr; // Special handling for variadic fcntl
DLSYM_WRAPPER(void, exit, (int status), (status), "exit")
#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS
DLSYM_WRAPPER(int, pipe, (int pipefd[2]), (pipefd), "pipe")
#endif

// Memory Mapping
DLSYM_WRAPPER(void*, mmap,
              (void* addr, size_t length, int prot, int flags, int fd,
@@ -2437,29 +2432,6 @@ fcntl(int fd, int cmd, ...) {
    }
}

#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS
void
exit(int status) {
    // GekkoFS cleanup might be needed before exit (e.g., flushing,
    // releasing resources) This should ideally be in CTX destructor or a
    // dedicated shutdown function.
    DEBUG_INFO("[GKFS] exit(status={})", status);
    // gkfs::PreloadContext::getInstance()->shutdown(); // Example
    dlsym_exit(status);
    __builtin_unreachable(); // To tell compiler exit doesn't return
}

int
pipe(int pipefd[2]) {
    gkfs_init_routine_placeholder();
    // Pipes are usually not intercepted by file system shims unless they
    // are named pipes (FIFOs) and GekkoFS implements them. Standard
    // anonymous pipes are kernel objects.
    DEBUG_INFO("[BYPASS] pipe()");
    return dlsym_pipe(pipefd);
}
#endif

//------------------------- Memory Mapping
//-----------------------------------//

Loading