ln command needs superuser privileges, oddly that test had run
successfully before.
Fixes: https://tracker.ceph.com/issues/43250
Signed-off-by: Rishabh Dave <ridave@redhat.com>
There were a couple of problems found by flake8 in the qa/
directory (most of them fixed now). Enabling flake8 during the usual
check runs hopefully avoids adding new issues in the future.
Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
The traceback would screw up the equality checks.
Also, use unittest asserts so we can easily see the assert values.
Fixes: https://tracker.ceph.com/issues/43247
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Adds tests that checks -
* reading conf option
* reading conf option after setting it twice
* reading conf option after setting it after a reset
Signed-off-by: Rishabh Dave <ridave@redhat.com>
In the test
test_cephfs_shell.TestMisc.test_issue_cephfs_shell_cmd_at_invocation,
don't set the shell option with in the command to be tested since
CephFS shell can now read it's value from ceph.conf.
Also, add methods to set config options for vstart as well teuthology
testing.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Since teuthology initializes stderr to None by default, absence of this
breaks the tests accessing stderr of commands executed within the test
when the execution is using teuthology.
Fixes: https://tracker.ceph.com/issues/42806
Signed-off-by: Rishabh Dave <ridave@redhat.com>
The default behaviour by cmd2 for help command with no argument is to
print all possible commands and return 1. This leads to a failure even
when test is supposed to pass.
Fixes: https://tracker.ceph.com/issues/42101
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Let run_cephfs_shell_cmd() return the object instead of output in string
format so that stderr, return value, etc. of the command executed
remain available. And add a new method that returns only output of the
CephFS shell command executed.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Convert cmd to string if it is passed as list to
run_cephfs_shell_cmd(). Allowing cmd to be list would be nice since
elsewhere, in tests, command to be executed must be a list of arguments
rather than string of arguments separated by spaces.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Rename _cephfs_shell() to run_cephfs_shell_cmd() and add a default
client for run_cephfs_shell_cmd() since most of tests in this
testsuite will need only one client.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Copy the method named humanize from cephfs-shell so that output can be
compared. Unfortunately, importing this method isn't possible since the
dash in "cephfs-shell" leads to an syntax error.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Add a method to test that the cd command changes the current working
directory to the path passed as an argument to it.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Add a method to test that the cd command changes the current working
directory to root when no argument is passed.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Move tests into different classes created on the basis of a shell
functionality within the testsuite. This arrangement allows running
tests related to only one functionality at a time.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Add a new method that runs the given CephFS shell script on the given
mount and returns the output with whitespace removed.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Add a method to test_cephfs_shell.py that allows running CephFS shell
script using option "-b" of cephfs-shell.
Signed-off-by: Rishabh Dave <ridave@redhat.com>