Now, we don't support ceph versions < nautilus this function
can move to a generic file so that nautilus specific functions
can be written here. Moved GetNamespace() and the corresponding
test function.
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
The GetLastVersion returns a number representing the most recent
read/write version for the io context.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Previously, ParseCmdLineArgs was the function directly wrapping the
ceph rados_conf_parse_argv function. This function has the improper
(IMO) behavior of assuming you didn't know your own argv[0] and just
always stuck "placeholder" in argv[0]. This function adds a more
direct wrapper ParseConfigArgv that allows the caller to pass an
full argv, and they can put any placholder value desired if they want.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Organize the rados package a bit more by moving functions that wrap
rados_xyz_command functions into a dedicated file. Move related test to
a separate file as well.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Clean up the temporary file using a defer and make sure that the
errors returned by the functions in the defer func are checked.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
It appears that ceph octopus (currently testing as master) is stricter
about some inputs and the old formatting in the test was failing.
Use formatting that all versions should be happy with.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
RadosError-prefixes are not recommended, instead just Err as prefix is
used.
Also, errors are constants, not variables.
For existing users, backwards compatible constants are available. These
will need to be removed in a future go-ceph release.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
The code path where the pools result buffer was increased in size
then re-fetched was not being tested. Test it.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Testfiy's assert and require libs have helpful functions for
checking values. Use them to reduce a bunch of boilerplate code in the
TestGetPoolByName function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
There is no good reason why the internal error handling support should
be exposed outside the rados package. Make the function lower-cased and
thus private.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
When working on the previous rbd change it was determined that the
connection setup code would block forever if the ceph config was missing
or bad when running the tests. Adjust the connection setup in the rados
pkg such that the tests will not block forever.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Keeping the _test.go code in the same package allows for the testing
of private functions. AFAIK it is more conventional as well.
Signed-off-by: John Mulligan <jmulligan@redhat.com>