Bug 1571896 - lsmcli [command] --file / --fileas proceeds even with nonexistent file
Summary: lsmcli [command] --file / --fileas proceeds even with nonexistent file
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libstoragemgmt
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tony Asleson
QA Contact: Jakub Krysl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-25 15:55 UTC by Jakub Krysl
Modified: 2018-12-10 17:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-10 17:41:00 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Jakub Krysl 2018-04-25 15:55:15 UTC
Description of problem:
When using arguments --file or --fileas with value of nonexistent file (let's say "nonexistent"), the command does not do any checking and probably ignores the argument instead. The command succeeds.

# lsmcli -u "sim://" fs-create --pool POOL_ID_00001 --name test --size 1G
ID          | Name | Total Space | Free Space | Pool ID       | System ID
-------------------------------------------------------------------------
FS_ID_00001 | test | 1073741824  | 1073741824 | POOL_ID_00001 | sim-01
# lsmcli -u "sim://" fs-dependants --fs FS_ID_00001
False
# lsmcli -u "sim://" fs-dependants --fs FS_ID_00001 --file "nonexistent"
False
# echo $?
0

Note: lsmcli fs-snap-restore has the same bahaviour.

Version-Release number of selected component (if applicable):
libstoragemgmt-1.6.1-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. lsmcli -u "sim://" fs-create --pool POOL_ID_00001 --name test --size 1G
2. lsmcli -u "sim://" fs-dependants --fs FS_ID_00001 --file "nonexistent"


Actual results:
False

Expected results:
lsmcli error: --file "nonexistent" does not exist

Additional info:

Comment 2 Tony Asleson 2018-12-10 17:41:00 UTC
The simulator has limitations, this is one of them.  To support this feature we would need the ability to simulate the FS too and allow some type of interface outside lsmcli to create files etc. so that the sim plugin would have something to check against.


Note You need to log in before you can comment on or make changes to this bug.