Commit 89536903 authored by Ramon Nou's avatar Ramon Nou
Browse files

Merge branch 'rnou/335-add-tests-for-proxy' into 'master'

"Add tests for proxy and malleability to increase coverage"

Closes #335

Closes #335

See merge request !222
parents 676c3917 9535fa0f
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### New
  - Added cppcheck code checking capabilities ([!214](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/214))
  - Tests to cover proxy and malleability ([!222](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/222))
  
### Changed 
  - Tests check ret for -1 instead of 10000 fd ([!320](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/320))
+2 −1
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@
        "CMAKE_INSTALL_PREFIX": "${sourceDir}/gkfs/install",
        "GKFS_USE_GUIDED_DISTRIBUTION": true,
        "GKFS_ENABLE_PARALLAX": false,
        "GKFS_BUILD_TOOLS": true,
        "GKFS_BUILD_TESTS": true,
        "GKFS_INSTALL_TESTS": true,
        "GKFS_CHUNK_STATS": true,
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ load_hostfile(const std::string& lfpath) {
           uri.find("na+sm") != std::string::npos) {
            PROXY_DATA->use_auto_sm(true);
            PROXY_DATA->log()->info(
                    "{}() auto_sm detected in daemon hosefile. Enabling it on proxy ...",
                    "{}() auto_sm detected in daemon hostfile. Enabling it on proxy ...",
                    __func__);
        }

+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,9 @@ gkfs_enable_python_testing(
    ${CMAKE_BINARY_DIR}/src/client/
    ${CMAKE_BINARY_DIR}/tests/integration/harness/
    ${CMAKE_BINARY_DIR}/examples/gfind/
    ${CMAKE_BINARY_DIR}/examples/user_library/
    ${CMAKE_BINARY_DIR}/tools/
    ${CMAKE_BINARY_DIR}/src/proxy/
    LIBRARY_PREFIX_DIRECTORIES ${CMAKE_PREFIX_PATH}
)

+36 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ from pathlib import Path
from harness.logger import logger, initialize_logging, finalize_logging
from harness.cli import add_cli_options, set_default_log_formatter
from harness.workspace import Workspace, FileCreator
from harness.gkfs import Daemon, Client, ShellClient, FwdDaemon, FwdClient, ShellFwdClient, FwdDaemonCreator, FwdClientCreator
from harness.gkfs import Daemon, Client, Proxy, ShellClient, FwdDaemon, FwdClient, ShellFwdClient, FwdDaemonCreator, FwdClientCreator
from harness.reporter import report_test_status, report_test_headline, report_assertion_pass

def pytest_configure(config):
@@ -122,6 +122,22 @@ def gkfs_daemon_parallaxdb(test_workspace, request):
def gkfs_daemon(request):
    return request.getfixturevalue(request.param)

@pytest.fixture
def gkfs_daemon_proxy(test_workspace, request):  
    interface = request.config.getoption('--interface')
    daemon = Daemon(interface, "rocksdb", test_workspace, True)

    yield daemon.run()
    daemon.shutdown()

@pytest.fixture
def gkfs_proxy(test_workspace):
    """
    Sets up a gekkofs proxy environment.
    """
    proxy = Proxy(test_workspace)
    yield proxy.run()
    proxy.shutdown()

@pytest.fixture
def gkfs_client(test_workspace):
@@ -133,6 +149,16 @@ def gkfs_client(test_workspace):

    return Client(test_workspace)

@pytest.fixture
def gkfs_client_proxy(test_workspace):
    """
    Sets up a gekkofs client environment so that
    operations (system calls, library calls, ...) can
    be requested from a co-running daemon.
    """

    return Client(test_workspace, True)

@pytest.fixture
def gkfs_shell(test_workspace):
    """
@@ -142,6 +168,15 @@ def gkfs_shell(test_workspace):

    return ShellClient(test_workspace)
    
@pytest.fixture
def gkfs_shell_proxy(test_workspace):
    """
    Sets up a gekkofs environment so that shell commands
    (stat, ls, mkdir, etc.) can be issued to a co-running daemon.
    """

    return ShellClient(test_workspace,True)

@pytest.fixture
def file_factory(test_workspace):
    """
Loading