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>