The defer function in TestMountWithRoot was always trying to call
unmount before release. This is not correct if the fs was not mounted
so we reorganize this code to more closely match what should be done
in normal practice.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Somehow we managed to introduce extra code into TestCreateMount that
had it create two mounts. This is undesirable for this test so this
change eliminates the extra unwanted invocation.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Previously, the mds name was hardcoded in the tests to match that set up
by "micro-osd.sh". We continue to default to that value, but allow the
test to be supplied a custom value by the environment.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add a utility function to test cases that expect the cephfs file system
to be mounted locally and accessible.
Add environment vars to configure the location of the mount point as
well whether the function causes the test to be skipped (the default)
or force an early but clear failure.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The existing Mount() method did not provide a way to access the root
path argument to ceph_mount. This new function allows the caller to
specify an alternate root dir for the mount.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Now that we have mds command function, we can use it to check for the id
we passed to CreateMountWithId appears in the session list.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The ceph api function supports passing a string to identify the
client doing the mount. Expose that aspect of the api with a
new function CreateMountWithId.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
In the cephfs tests the setup of the mount/connection was largely being
done as a copy-n-paste. This change adds a common setup function for
most of the test cases that need an active connection.
Similar to other recent changes this also adds a timeout such that
if the test fails to get a connection it will fail quickly rather
than block forever.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Now that cephfs_test.go is part of the cephfs package, the linter is
checking it and finding errors. Fix them.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This change replaces a couple of functions from the "assert" package
with the corresponding functions from the "require", where the
following code relies on a non-nil object.
Signed-off-by: Sven Anderson <sven@redhat.com>
This commit adds the following cephfs functions:
* Unmount // Unmounting is necessary to cleanup mounts
* Release // Release destroys the cmount ~ end of transaction
* RemoveDir // inverse of MakeDir
* Chown // change ownership of file or directory
* Chmod // change permissions of file or directory
Tests are included for each function.
In addition to these changes modifications to:
.travis.yml, Dockerfile, and Makefile
were made to accomodate tests to mount the ceph volume. Tests use
fuse to mount the volume which requires adding:
--device /dev/fuse --cap-add SYS_ADMIN --security-opt \
apparmor:unconfined
to the docker container (alternatively --privileged works but adds
additional permissions).
Changes to README add the above docker changes as well as point
users to the necessary ceph development libraries.
* CephError uses syscall for string version of error
* Add error logging for every function
* Add RemoveDir() function
* Add Unmount() function
* Add Release() function
* Add Chown() function
* Add Chmod() function