summaryrefslogtreecommitdiffhomepage
path: root/test/fuse/linux/fuse_base.cc
diff options
context:
space:
mode:
authorCraig Chi <craigchi@google.com>2020-08-04 14:31:15 -0700
committerCraig Chi <craigchi@google.com>2020-08-04 14:48:37 -0700
commit9094adfc2792945b344e393de977b3e8627ace72 (patch)
treec36e750db051d54f078763bf934c93c5d88a5451 /test/fuse/linux/fuse_base.cc
parentaf2f456735252b8412af676a3d6ff61690fdf9a7 (diff)
Fix FUSE integration test failed with ECONNREFUSED
The newer version of FUSE_INIT checks the response from the FUSE server if its major number is equal to 7. If it's not, then FUSE_INIT fails and further filesystem operations will get ECONNREFUSED. To mitigate this issue, we can send back a response with major version equals to 7 when consuming the first FUSE_INIT request. Fixes #3500
Diffstat (limited to 'test/fuse/linux/fuse_base.cc')
-rw-r--r--test/fuse/linux/fuse_base.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/fuse/linux/fuse_base.cc b/test/fuse/linux/fuse_base.cc
index 6c8432fd0..32221e7b6 100644
--- a/test/fuse/linux/fuse_base.cc
+++ b/test/fuse/linux/fuse_base.cc
@@ -25,9 +25,9 @@
#include <iostream>
+#include "absl/strings/str_format.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "absl/strings/str_format.h"
#include "test/util/posix_error.h"
#include "test/util/test_util.h"
@@ -100,8 +100,11 @@ PosixError FuseTest::ConsumeFuseInit() {
.error = 0,
.unique = 2,
};
- // Returns an empty init out payload since this is just a test.
- struct fuse_init_out out_payload;
+ // Returns a fake fuse_init_out with 7.0 version to avoid ECONNREFUSED
+ // error in the initialization of FUSE connection.
+ struct fuse_init_out out_payload = {
+ .major = 7,
+ };
iov_out[0].iov_len = sizeof(out_header);
iov_out[0].iov_base = &out_header;
iov_out[1].iov_len = sizeof(out_payload);