from tasks.cephfs.cephfs_test_case import CephFSTestCase
from teuthology.exceptions import CommandFailedError
import errno
+import platform
import time
import json
import logging
p.wait()
def test_fuse_mount_on_already_mounted_path(self):
+ if platform.system() != "Linux":
+ self.skipTest("Require Linux platform")
+
if not isinstance(self.mount_a, FuseMount):
self.skipTest("Require FUSE client")
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+
+#if defined(__linux__)
#include <libgen.h>
#include <sys/vfs.h>
#include <sys/xattr.h>
#include <linux/magic.h>
+#endif
// ceph
#include "common/errno.h"
#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK))
#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
+#if defined(__linux__)
#ifndef FUSE_SUPER_MAGIC
#define FUSE_SUPER_MAGIC 0x65735546
#endif
#define _CEPH_CLIENT_ID "ceph.client_id"
+#endif
using namespace std;
struct fuse_args args;
};
+#if defined(__linux__)
static int already_fuse_mounted(const char *path, bool &already_mounted)
{
struct statx path_statx;
return err;
}
+#else // non-linux platforms
+static int already_fuse_mounted(const char *path, bool &already_mounted)
+{
+ already_mounted = false;
+ return 0;
+}
+#endif
static int getgroups(fuse_req_t req, gid_t **sgids)
{
import sys
import argparse
import errno
+import platform
from subprocess import Popen
def ceph_options(mntops):
mount_cmd.communicate()
if (mount_cmd.returncode != 0):
- if (mount_cmd.returncode != errno.EBUSY):
+ if (platform.system() == "Linux"):
+ if (mount_cmd.returncode != errno.EBUSY):
+ print("Mount failed with status code: {}".format(mount_cmd.returncode))
+ else:
print("Mount failed with status code: {}".format(mount_cmd.returncode))
if __name__ == '__main__':