Project

General

Profile

Actions

Bug #55710

closed

cephfs-shell: exit code unset when command has missing argument

Added by Rishabh Dave almost 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
cephfs-shell, qa-suite
Labels (FS):
qa, qa-failure
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

In following case the exit code should be non-zero to indicate failure -

$ cephfs-shell -- get dump5
usage: get [-h] [-f] remote_path local_path
get: error: the following arguments are required: local_path
$ echo $?
0

Discovered this bug through following test failure -

2022-05-19 17:41:49,840.840 INFO:__main__:FAIL: test_get_without_target_name (tasks.cephfs.test_cephfs_shell.TestGetAndPut)
2022-05-19 17:41:49,840.840 INFO:__main__:Test that get should fail when there is no target name
2022-05-19 17:41:49,840.840 INFO:__main__:
2022-05-19 17:41:49,840.840 INFO:__main__:----------------------------------------------------------------------
2022-05-19 17:41:49,840.840 INFO:__main__:Traceback (most recent call last):
2022-05-19 17:41:49,840.840 INFO:__main__:  File "/home/rishabh/repos/ceph/test/qa/tasks/cephfs/test_cephfs_shell.py", line 376, in test_get_without_target_name
2022-05-19 17:41:49,841.841 INFO:__main__:    self.get_cephfs_shell_cmd_output("get dump5")
2022-05-19 17:41:49,841.841 INFO:__main__:AssertionError: CommandFailedError not raised
2022-05-19 17:41:49,841.841 INFO:__main__:
2022-05-19 17:41:49,841.841 INFO:__main__:

The error was introduced here - https://github.com/ceph/ceph/pull/46110/files#diff-35294eb9e54c75ffc1459f1c03a06dfbc7e921aebeb48a41418b5f60f21953d8R474

Actions #1

Updated by Rishabh Dave almost 2 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 46337
Actions #2

Updated by Patrick Donnelly almost 2 years ago

  • Target version set to v18.0.0
  • Source set to Development
  • Component(FS) cephfs-shell added
  • Labels (FS) qa, qa-failure added
Actions #3

Updated by Rishabh Dave over 1 year ago

  • Status changed from Fix Under Review to Resolved

The PR was merged by Venky few months ago - https://github.com/ceph/ceph/pull/46337#event-6657873439.

Actions

Also available in: Atom PDF