Skip to content

Commit

Permalink
completions: add ocp set-error-injection command
Browse files Browse the repository at this point in the history
The command injects error conditions.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Jul 24, 2024
1 parent 54f684c commit 4564405
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
24 changes: 24 additions & 0 deletions completions/_nvme
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,29 @@ _nvme () {
_arguments '*:: :->subcmds'
_describe -t commands "nvme ocp get-error-injection options" _get_error_injection
;;
(set-error-injection)
local _set_error_injection
_set_error_injection=(
/dev/nvme':supply a device to use (required)'
--data=':Error injection data structure entries'
-d':alias for --data'
--number=':Number of valid error injection data entries'
-n':alias for --number'
--no-uuid':Skip UUID index search'
-N':alias for --no-uuid'
--type=':Error injection type'
-t':alias for --type'
--nrtdp=':Number of reads to trigger device panic'
-r':alias for --nrtdp'
--verbose':Increase the information detail in the output.'
-v':alias for --verbose'
--output-format=':Output format: normal|json|binary'
-o ':alias for --output-format'
--timeout=':value for timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme ocp set-error-injection options" _set_error_injection
;;
(*)
_files
;;
Expand Down Expand Up @@ -2543,6 +2566,7 @@ _nvme () {
set-telemetry-profile':Set Telemetry Profile'
tcg-configuration-log':tcg configuration log'
get-error-injection':get error injection'
set-error-injection':set error injection'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme ocp options" _ocp
Expand Down
6 changes: 5 additions & 1 deletion completions/bash-nvme-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,10 @@ plugin_ocp_opts () {
"get-error-injection")
opts+=" --sel= -s --no-uuid -n"
;;
"set-error-injection")
opts+=" --data= -d --number= -n --no-uuid -N --type= -t \
--nrtdp= -r --verbose -v --output-format -o --timeout="
;;
"help")
opts+=$NO_OPTS
;;
Expand Down Expand Up @@ -1565,7 +1569,7 @@ _nvme_subcmds () {
set-dssd-power-state-feature get-dssd-power-state-feature \
telemetry-string-log set-telemetry-profile \
set-dssd-async-event-config get-dssd-async-event-config \
get-error-injection"
get-error-injection set-error-injection"
)

# Associative array mapping plugins to corresponding option completions
Expand Down

0 comments on commit 4564405

Please sign in to comment.