Commit 90e03f6c authored by Ramon Nou's avatar Ramon Nou
Browse files

GCC 12.1 update and statvfs

Added statvfs in tests

enable extra features in gekkofs
parent 897c31d4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -49,6 +49,12 @@ gkfs:
  interruptible: true
  needs: []
  script:
    # Change config.hpp with sed to enable extra features
    - sed -i 's/\/\/constexpr auto use_atime = false;/constexpr auto use_atime = true;/g' "${CI_PROJECT_DIR}/src/config.hpp"
    - sed -i 's/\/\/constexpr auto use_ctime = false;/constexpr auto use_ctime = true;/g' "${CI_PROJECT_DIR}/src/config.hpp"
    - sed -i 's/\/\/constexpr auto use_mtime = false;/constexpr auto use_mtime = true;/g' "${CI_PROJECT_DIR}/src/config.hpp"
    - sed -i 's/\/\/constexpr auto use_link_cnt = false;/constexpr auto use_link_cnt = true;/g' "${CI_PROJECT_DIR}/src/config.hpp"
    - sed -i 's/\/\/constexpr auto use_blocks = false;/constexpr auto use_blocks = true;/g' "${CI_PROJECT_DIR}/src/config.hpp"
    - mkdir -p ${BUILD_PATH} && cd ${BUILD_PATH}
    - cmake
      -Wdev
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include <mutex>
#include <memory>
#include <atomic>
#include <array>

namespace gkfs::filemap {

+15 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

from sre_parse import State
import harness
from pathlib import Path
import errno
@@ -80,6 +81,9 @@ def test_open_error(gkfs_daemon, gkfs_client):
    assert ret.retval == -1
    assert ret.errno == errno.ENOENT

    ret = gkfs_client.open(file3, os.O_CREAT | stat.S_IFSOCK | os.O_EXCL | os.O_WRONLY)
    assert ret.retval == 10000

def test_access_error(gkfs_daemon, gkfs_client):

    file = gkfs_daemon.mountdir / "file"
@@ -123,5 +127,16 @@ def test_statfs(gkfs_daemon, gkfs_client):
    assert ret.statfsbuf.f_ffree == 0


def test_statvfs(gkfs_daemon, gkfs_client):
    # Statfs check most of the outputs

    ret = gkfs_client.statvfs(gkfs_daemon.mountdir)  
    assert ret.retval == 0
    assert ret.statvfsbuf.f_bsize != 0
    assert ret.statvfsbuf.f_blocks != 0
    assert ret.statvfsbuf.f_bfree != 0
    assert ret.statvfsbuf.f_bavail != 0
    assert ret.statvfsbuf.f_files == 0
    assert ret.statvfsbuf.f_ffree == 0

 
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ add_executable(gkfs.io
    gkfs.io/unlink.cpp
    gkfs.io/access.cpp
    gkfs.io/statfs.cpp
    gkfs.io/statvfs.cpp
)

include(FetchContent)
+3 −0
Original line number Diff line number Diff line
@@ -102,6 +102,9 @@ access_init(CLI::App& app);
void
statfs_init(CLI::App& app);

void
statvfs_init(CLI::App& app);

// UTIL
void
file_compare_init(CLI::App& app);
Loading