Skip to content

Commit 11814da

Browse files
committed
add patch tests for updated behavior
1 parent f8b4f82 commit 11814da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/cmd/basicresources.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ os::cmd::expect_success "echo '${group_json}' | oc create -f -"
325325
os::cmd::expect_success "oc patch group patch-group -p 'users: [\"myuser\"]' --loglevel=8"
326326
os::cmd::expect_success_and_text 'oc get group patch-group -o yaml' 'myuser'
327327
os::cmd::expect_success "oc patch group patch-group -p 'users: []' --loglevel=8"
328+
# applying the same patch twice results in exit code 0, and "not patched" text
329+
os::cmd::expect_success_and_text "oc patch group patch-group -p 'users: []'" "not patched"
330+
# applying an invalid patch results in exit code 1 and an error
331+
os::cmd::expect_failure_and_text "oc patch group patch-group -p 'users: \"\"'" "cannot restore slice from string"
328332
os::cmd::expect_success_and_text 'oc get group patch-group -o yaml' 'users: \[\]'
329333
echo "patch: ok"
330334
os::test::junit::declare_suite_end

0 commit comments

Comments
 (0)