diff --git a/src/client/gkfs_functions.cpp b/src/client/gkfs_functions.cpp index 3156d8f61ba1ae7f986a95cf012de7d21e749535..bcda837691960ebe40102b2ca13f87b0d01e9bb6 100644 --- a/src/client/gkfs_functions.cpp +++ b/src/client/gkfs_functions.cpp @@ -418,6 +418,10 @@ off_t gkfs_lseek(unsigned int fd, off_t offset, unsigned int whence) { off_t gkfs_lseek(shared_ptr gkfs_fd, off_t offset, unsigned int whence) { switch (whence) { case SEEK_SET: + if (offset < 0) { + errno = EINVAL; + return -1; + } gkfs_fd->pos(offset); break; case SEEK_CUR: @@ -1017,7 +1021,6 @@ int gkfs_getdents64(unsigned int fd, * @return 0 on success or -1 on error */ int gkfs_mk_symlink(const std::string& path, const std::string& target_path) { - gkfs::preload::init_ld_env_if_needed(); /* The following check is not POSIX compliant. * In POSIX the target is not checked at all. * Here if the target is a directory we raise a NOTSUP error. @@ -1064,7 +1067,6 @@ int gkfs_mk_symlink(const std::string& path, const std::string& target_path) { * @return 0 on success or -1 on error */ int gkfs_readlink(const std::string& path, char* buf, int bufsize) { - gkfs::preload::init_ld_env_if_needed(); auto md = gkfs::util::get_metadata(path, false); if (md == nullptr) { LOG(DEBUG, "Named link doesn't exist"); diff --git a/src/client/hooks.cpp b/src/client/hooks.cpp index 788076d39a4abcad344505dc9ab097d317109fb9..a4571035fbaf9f74e3a5b627d2cfa3b8d11f8abe 100644 --- a/src/client/hooks.cpp +++ b/src/client/hooks.cpp @@ -32,6 +32,7 @@ extern "C" { namespace { +// TODO replace all internal gkfs errno variable usage with LEAF inline int with_errno(int ret) { return (ret < 0) ? -errno : ret; } diff --git a/src/client/preload.cpp b/src/client/preload.cpp index cf2e5b48f1eda4f0ab0d65cf8cce3b10c07a572d..33043ce789d1e58557abdf11d71ca293cdff5cc5 100644 --- a/src/client/preload.cpp +++ b/src/client/preload.cpp @@ -220,6 +220,8 @@ void init_ld_env_if_needed() { * Called initially ONCE when preload library is used with the LD_PRELOAD environment variable */ void init_preload() { + // The original errno value will be restored after initialization to not leak internal error codes + auto oerrno = errno; CTX->enable_interception(); gkfs::preload::start_self_interception(); @@ -252,6 +254,7 @@ void init_preload() { #endif gkfs::preload::start_interception(); + errno = oerrno; } /** diff --git a/tests/integration/data/test_data_integrity.py b/tests/integration/data/test_data_integrity.py index 0a166bc3c6dbabbeb9374729b8281a73c51e07d5..32f2df095c7772b2954af7299a629cbb119e24af 100644 --- a/tests/integration/data/test_data_integrity.py +++ b/tests/integration/data/test_data_integrity.py @@ -47,7 +47,6 @@ def test_data_integrity(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! # test stat on existing dir ret = gkfs_client.stat(topdir) diff --git a/tests/integration/data/test_truncate.py b/tests/integration/data/test_truncate.py index 743832a9e6b0398aecb945a4437ebd55b874c130..199af554de889b45218a1c584f455495a2a85830 100644 --- a/tests/integration/data/test_truncate.py +++ b/tests/integration/data/test_truncate.py @@ -37,11 +37,9 @@ def test_truncate(gkfs_daemon, gkfs_client): ret = gkfs_client.write_random(truncfile, buf_length) assert ret.retval == buf_length - assert ret.errno == 115 # FIXME: Should be 0! ret = gkfs_client.stat(truncfile) - assert ret.errno == 115 # FIXME: Should be 0! assert ret.statbuf.st_size == buf_length # truncate it @@ -49,12 +47,10 @@ def test_truncate(gkfs_daemon, gkfs_client): trunc_size = buf_length // 2 ret = gkfs_client.truncate(truncfile, trunc_size) - assert ret.errno == 115 # FIXME: Should be 0! assert ret.retval == 0 # check file length ret = gkfs_client.stat(truncfile) - assert ret.errno == 115 # FIXME: Should be 0! assert ret.statbuf.st_size == trunc_size # verify contents by writing a new file (random content is seeded) and checksum both @@ -69,30 +65,25 @@ def test_truncate(gkfs_daemon, gkfs_client): ret = gkfs_client.write_random(truncfile_verify, trunc_size) assert ret.retval == trunc_size - assert ret.errno == 115 # FIXME: Should be 0! ret = gkfs_client.stat(truncfile_verify) - assert ret.errno == 115 # FIXME: Should be 0! assert ret.statbuf.st_size == trunc_size ret = gkfs_client.file_compare(truncfile, truncfile_verify, trunc_size) assert ret.retval == 0 - assert ret.errno == 115 # FIXME: Should be 0! # trunc at byte 712345 (middle of chunk) # TODO feed chunksize into test to make sure it is always in the middle of the chunk trunc_size = 712345 ret = gkfs_client.truncate(truncfile, trunc_size) - assert ret.errno == 115 # FIXME: Should be 0! assert ret.retval == 0 # check file length ret = gkfs_client.stat(truncfile) - assert ret.errno == 115 # FIXME: Should be 0! assert ret.statbuf.st_size == trunc_size # verify contents by writing a new file (random content is seeded) and checksum both @@ -107,14 +98,11 @@ def test_truncate(gkfs_daemon, gkfs_client): ret = gkfs_client.write_random(truncfile_verify_2, trunc_size) assert ret.retval == trunc_size - assert ret.errno == 115 # FIXME: Should be 0! ret = gkfs_client.stat(truncfile_verify_2) - assert ret.errno == 115 # FIXME: Should be 0! assert ret.statbuf.st_size == trunc_size ret = gkfs_client.file_compare(truncfile, truncfile_verify_2, trunc_size) assert ret.retval == 0 - assert ret.errno == 115 # FIXME: Should be 0! diff --git a/tests/integration/directories/test_directories.py b/tests/integration/directories/test_directories.py index fc342f4d0487a2301815c9cd50938ed5984f3a2c..13ad035a2f9708270aa541f1ae599aa2a0452990 100644 --- a/tests/integration/directories/test_directories.py +++ b/tests/integration/directories/test_directories.py @@ -42,19 +42,16 @@ def test_mkdir(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! # test stat on existing dir ret = gkfs_client.stat(topdir) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! assert stat.S_ISDIR(ret.statbuf.st_mode) # open topdir ret = gkfs_client.open(topdir, os.O_DIRECTORY) assert ret.retval != -1 - assert ret.errno == 115 #FIXME: Should be 0! # read and write should be impossible on directories @@ -77,19 +74,16 @@ def test_mkdir(gkfs_daemon, gkfs_client): ret = gkfs_client.opendir(topdir) assert ret.dirp is not None - assert ret.errno == 115 #FIXME: Should be 0! ret = gkfs_client.readdir(topdir) # XXX: This might change in the future if we add '.' and '..' assert len(ret.dirents) == 0 - assert ret.errno == 115 #FIXME: Should be 0! # close directory # TODO: disabled for now because we have no way to keep DIR* alive # between gkfs.io executions # ret = gkfs_client.opendir(XXX) - # assert ret.errno == 115 #FIXME: Should be 0! # populate top directory @@ -99,14 +93,12 @@ def test_mkdir(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! ret = gkfs_client.open(file_a, os.O_CREAT, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval != -1 - assert ret.errno == 115 #FIXME: Should be 0! ret = gkfs_client.readdir(gkfs_daemon.mountdir) @@ -114,7 +106,6 @@ def test_mkdir(gkfs_daemon, gkfs_client): assert len(ret.dirents) == 1 assert ret.dirents[0].d_name == 'top' assert ret.dirents[0].d_type == 4 # DT_DIR - assert ret.errno == 115 #FIXME: Should be 0! expected = [ ( dir_a.name, 4 ), # DT_DIR @@ -124,7 +115,6 @@ def test_mkdir(gkfs_daemon, gkfs_client): ret = gkfs_client.readdir(topdir) assert len(ret.dirents) == len(expected) - assert ret.errno == 115 #FIXME: Should be 0! for d,e in zip(ret.dirents, expected): assert d.d_name == e[0] @@ -141,7 +131,6 @@ def test_mkdir(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! expected = [ ( topdir.name, 4 ), # DT_DIR @@ -150,7 +139,6 @@ def test_mkdir(gkfs_daemon, gkfs_client): ret = gkfs_client.readdir(gkfs_daemon.mountdir) assert len(ret.dirents) == len(expected) - assert ret.errno == 115 #FIXME: Should be 0! for d,e in zip(ret.dirents, expected): assert d.d_name == e[0] @@ -162,7 +150,6 @@ def test_mkdir(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! expected = [ ( topdir.name, 4 ), # DT_DIR @@ -171,7 +158,6 @@ def test_mkdir(gkfs_daemon, gkfs_client): ret = gkfs_client.readdir(gkfs_daemon.mountdir) assert len(ret.dirents) == len(expected) - assert ret.errno == 115 #FIXME: Should be 0! for d,e in zip(ret.dirents, expected): assert d.d_name == e[0] @@ -184,7 +170,6 @@ def test_mkdir(gkfs_daemon, gkfs_client): ret = gkfs_client.readdir(dir_a) assert len(ret.dirents) == len(expected) - assert ret.errno == 115 #FIXME: Should be 0! for d,e in zip(ret.dirents, expected): assert d.d_name == e[0] diff --git a/tests/integration/forwarding/test_map.py b/tests/integration/forwarding/test_map.py index 5a2d33a0b306f96f8afddb0cabd44acfe7bee654..86c412bb04a39e23fcb0b5a943c68830d76f26e7 100644 --- a/tests/integration/forwarding/test_map.py +++ b/tests/integration/forwarding/test_map.py @@ -44,14 +44,12 @@ def test_two_io_nodes(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf = b'42' ret = c00.write(file, buf, len(buf)) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = c00.open(file, @@ -59,14 +57,12 @@ def test_two_io_nodes(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file ret = c00.read(file, len(buf)) assert ret.buf == buf assert ret.retval == len(buf) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! file = d01.mountdir / "file-c01" @@ -77,14 +73,12 @@ def test_two_io_nodes(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf = b'42' ret = c01.write(file, buf, len(buf)) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = c01.open(file, @@ -92,14 +86,12 @@ def test_two_io_nodes(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file ret = c01.read(file, len(buf)) assert ret.buf == buf assert ret.retval == len(buf) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! # both files should be there and accessible by the two clients ret = c00.readdir(d00.mountdir) @@ -108,11 +100,9 @@ def test_two_io_nodes(gkfwd_daemon_factory, gkfwd_client_factory): assert ret.dirents[0].d_name == 'file-c00' assert ret.dirents[0].d_type == 8 # DT_REG - assert ret.errno == 115 #FIXME: Should be 0! assert ret.dirents[1].d_name == 'file-c01' assert ret.dirents[1].d_type == 8 # DT_REG - assert ret.errno == 115 #FIXME: Should be 0! with open(c00.log) as f: lines = f.readlines() @@ -149,14 +139,12 @@ def test_two_io_nodes_remap(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf = b'42' ret = c00.write(file, buf, len(buf)) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! with open(c00.log) as f: lines = f.readlines() @@ -181,14 +169,12 @@ def test_two_io_nodes_remap(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file buf = b'24' ret = c00.write(file, buf, len(buf)) assert ret.retval == len(buf) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! with open(c00.log) as f: lines = f.readlines() @@ -216,14 +202,12 @@ def test_two_io_nodes_operations(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf = b'42' ret = c00.write(file, buf, len(buf)) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = c00.open(file, @@ -231,14 +215,12 @@ def test_two_io_nodes_operations(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file ret = c00.read(file, len(buf)) assert ret.buf == buf assert ret.retval == len(buf) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = c01.open(file, @@ -246,14 +228,12 @@ def test_two_io_nodes_operations(gkfwd_daemon_factory, gkfwd_client_factory): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file ret = c01.read(file, len(buf)) assert ret.buf == buf assert ret.retval == len(buf) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! # the file should be there and accessible by the two clients ret = c00.readdir(d00.mountdir) @@ -262,7 +242,6 @@ def test_two_io_nodes_operations(gkfwd_daemon_factory, gkfwd_client_factory): assert ret.dirents[0].d_name == 'file-c00' assert ret.dirents[0].d_type == 8 # DT_REG - assert ret.errno == 115 #FIXME: Should be 0! # the file should be there and accessible by the two clients ret = c01.readdir(d01.mountdir) @@ -271,7 +250,6 @@ def test_two_io_nodes_operations(gkfwd_daemon_factory, gkfwd_client_factory): assert ret.dirents[0].d_name == 'file-c00' assert ret.dirents[0].d_type == 8 # DT_REG - assert ret.errno == 115 #FIXME: Should be 0! with open(c00.log) as f: lines = f.readlines() diff --git a/tests/integration/operations/test_read_operations.py b/tests/integration/operations/test_read_operations.py index 22e65ff95f52105991d138974234c8095ec3c067..3099b0c2c74dea7e6cb96ce6e2c5978b93a74a79 100644 --- a/tests/integration/operations/test_read_operations.py +++ b/tests/integration/operations/test_read_operations.py @@ -35,14 +35,12 @@ def test_read(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf = b'42' ret = gkfs_client.write(file, buf, len(buf)) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = gkfs_client.open(file, @@ -50,14 +48,12 @@ def test_read(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file ret = gkfs_client.read(file, len(buf)) assert ret.buf == buf assert ret.retval == len(buf) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! def test_pread(gkfs_daemon, gkfs_client): @@ -69,14 +65,12 @@ def test_pread(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf = b'42' ret = gkfs_client.pwrite(file, buf, len(buf), 1024) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = gkfs_client.open(file, @@ -84,14 +78,12 @@ def test_pread(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file at offset 1024 ret = gkfs_client.pread(file, len(buf), 1024) assert ret.buf == buf assert ret.retval == len(buf) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! def test_readv(gkfs_daemon, gkfs_client): @@ -103,7 +95,6 @@ def test_readv(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf_0 = b'42' @@ -111,7 +102,6 @@ def test_readv(gkfs_daemon, gkfs_client): ret = gkfs_client.writev(file, buf_0, buf_1, 2) assert ret.retval == len(buf_0) + len(buf_1) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = gkfs_client.open(file, @@ -119,7 +109,6 @@ def test_readv(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file ret = gkfs_client.readv(file, len(buf_0), len(buf_1)) @@ -127,7 +116,6 @@ def test_readv(gkfs_daemon, gkfs_client): assert ret.buf_0 == buf_0 assert ret.buf_1 == buf_1 assert ret.retval == len(buf_0) + len(buf_1) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! def test_preadv(gkfs_daemon, gkfs_client): @@ -139,7 +127,6 @@ def test_preadv(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # write a buffer we know buf_0 = b'42' @@ -147,7 +134,6 @@ def test_preadv(gkfs_daemon, gkfs_client): ret = gkfs_client.pwritev(file, buf_0, buf_1, 2, 1024) assert ret.retval == len(buf_0) + len(buf_1) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! # open the file to read ret = gkfs_client.open(file, @@ -155,12 +141,10 @@ def test_preadv(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! # read the file ret = gkfs_client.preadv(file, len(buf_0), len(buf_1), 1024) assert ret.buf_0 == buf_0 assert ret.buf_1 == buf_1 - assert ret.retval == len(buf_0) + len(buf_1) # Return the number of read bytes - assert ret.errno == 115 #FIXME: Should be 0! \ No newline at end of file + assert ret.retval == len(buf_0) + len(buf_1) # Return the number of read bytes \ No newline at end of file diff --git a/tests/integration/operations/test_write_operations.py b/tests/integration/operations/test_write_operations.py index c18987592ec5f3f80aefa9d767328b9c7765f91d..95a204c8889e27f60813e094036197a04a385c49 100644 --- a/tests/integration/operations/test_write_operations.py +++ b/tests/integration/operations/test_write_operations.py @@ -34,13 +34,11 @@ def test_write(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! buf = b'42' ret = gkfs_client.write(file, buf, len(buf)) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! def test_pwrite(gkfs_daemon, gkfs_client): @@ -51,14 +49,12 @@ def test_pwrite(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! buf = b'42' # write at the offset 1024 ret = gkfs_client.pwrite(file, buf, len(buf), 1024) assert ret.retval == len(buf) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! def test_writev(gkfs_daemon, gkfs_client): @@ -69,14 +65,12 @@ def test_writev(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! buf_0 = b'42' buf_1 = b'24' ret = gkfs_client.writev(file, buf_0, buf_1, 2) assert ret.retval == len(buf_0) + len(buf_1) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! def test_pwritev(gkfs_daemon, gkfs_client): @@ -87,11 +81,9 @@ def test_pwritev(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 10000 - assert ret.errno == 115 #FIXME: Should be 0! buf_0 = b'42' buf_1 = b'24' ret = gkfs_client.pwritev(file, buf_0, buf_1, 2, 1024) assert ret.retval == len(buf_0) + len(buf_1) # Return the number of written bytes - assert ret.errno == 115 #FIXME: Should be 0! diff --git a/tests/integration/position/test_lseek.py b/tests/integration/position/test_lseek.py index daf357c7ac237b15f37f1d1791cb7c99bdeda14e..356f34a64ec097e46854a5e0a5d0df34ea9c664f 100644 --- a/tests/integration/position/test_lseek.py +++ b/tests/integration/position/test_lseek.py @@ -51,13 +51,11 @@ def test_lseek(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! # test stat on existing dir ret = gkfs_client.stat(topdir) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! assert stat.S_ISDIR(ret.statbuf.st_mode) ret = gkfs_client.open(file_a, @@ -74,13 +72,12 @@ def test_lseek(gkfs_daemon, gkfs_client): ret = gkfs_client.lseek(file_a, -1, os.SEEK_SET) assert ret.retval == -1 - assert ret.errno == 115 #FIXME: Should be 22 + assert ret.errno == 22 # We can go further an empty file ret = gkfs_client.lseek(file_a, 5, os.SEEK_SET) assert ret.retval == 5 - assert ret.errno == 115 #FIXME: Should be 0 # Size needs to be 0 ret = gkfs_client.stat(file_a) @@ -106,11 +103,9 @@ def test_lseek(gkfs_daemon, gkfs_client): ret = gkfs_client.lseek(file_a, 0, os.SEEK_END) assert ret.retval == 2 #FAILS - assert ret.errno == 115 #FIXME: Should be 0 ret = gkfs_client.lseek(file_a, -2, os.SEEK_END) assert ret.retval == 0 #FAILS - assert ret.errno == 115 #FIXME: Should be 0 ret = gkfs_client.lseek(file_a, -3, os.SEEK_END) assert ret.retval == -1 #FAILS diff --git a/tests/integration/status/test_status.py b/tests/integration/status/test_status.py index d3684a241d288e0e2ce085c1430ca5b27487213d..aaa883fd1b975ed258db3a588a16a9ed53efc4ff 100644 --- a/tests/integration/status/test_status.py +++ b/tests/integration/status/test_status.py @@ -43,13 +43,11 @@ def test_statx(gkfs_daemon, gkfs_client): stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! # test statx on existing dir ret = gkfs_client.statx(0, topdir, 0, 0) assert ret.retval == 0 - assert ret.errno == 115 #FIXME: Should be 0! assert stat.S_ISDIR(ret.statbuf.stx_mode) ret = gkfs_client.open(file_a,