Univention Bugzilla – Attachment 7761 Details for
Bug 41631
Add a test for setting ucr variables with the ? operator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
proposed test
68ucr_conditional_set (text/plain), 1.36 KB, created by
Jürn Brodersen
on 2016-06-21 17:02:13 CEST
(
hide
)
Description:
proposed test
Filename:
MIME Type:
Creator:
Jürn Brodersen
Created:
2016-06-21 17:02:13 CEST
Size:
1.36 KB
patch
obsolete
>#!/usr/share/ucs-test/runner bash >## desc: Test Univention Config Registry conditional set >## bugs: [40728] >## tags: >## - basic >## - apptest >## exposure: careful > >. "$TESTLIBPATH/ucr.sh" || exit 137 >. "$TESTLIBPATH/base.sh" || exit 137 >UCR=ucr >KEY="test/40728" > >Assert () { # Assert $1 = $2, optional error message $3 > if [ "$1" != "$2" ]; then > echo "Test failed. ${3:-Got \"$1\" Expected \"$2\"}" > exit 110 > fi >} > >##### Beginning ##### >ucr unset test/40728 >/dev/null 2>&1 >ucr unset --force test/40728 >/dev/null 2>&1 > >##### Test conditional set ##### >debug Create "$KEY" >ucr set "$KEY"?conditional >/dev/null 2>&1 >Assert "$(ucr get "$KEY")" "conditional" > >debug Unconditional overwrite >ucr set "$KEY"=unconditional >/dev/null 2>&1 >Assert "$(ucr get "$KEY")" "unconditional" > >debug Conditional overwrite >ucr set "$KEY"?conditional >/dev/null 2>&1 >Assert "$(ucr get "$KEY")" "unconditional" > >debug Unset "$KEY" >ucr unset test/40728 >/dev/null 2>&1 > >debug Force layer create "$KEY" >ucr set --force "$KEY"?conditional-force >/dev/null 2>&1 >Assert "$(ucr get "$KEY")" "conditional-force" > >debug Create "$KEY" >ucr set "$KEY"?conditional >/dev/null 2>&1 >Assert "$(ucr get "$KEY")" "conditional-force" > >debug Unset force layer "$KEY" >ucr unset --force test/40728 >/dev/null 2>&1 >Assert "$(ucr get "$KEY")" "conditional" > >debug Cleanup >ucr unset test/40728 >/dev/null 2>&1 > >##### End ##### >exit 0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 41631
: 7761