forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_data.sh
executable file
·55 lines (37 loc) · 1.24 KB
/
generate_data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
@INCLUDE_COMMON@
#comment out next line to re-generate test data
exit 0
echo
echo ELEKTRA GENERATE DATA
echo
check_version
ROOT=$USER_ROOT
for PLUGIN in $PLUGINS; do
if is_not_rw_storage; then
echo "$PLUGIN not a read-write storage"
continue
fi
echo -------- "$PLUGIN" -----------
"$KDB" set "$ROOT" "root" > /dev/null
exit_if_fail "could not set root"
test "$("$KDB" ls "$ROOT")" = "$ROOT"
succeed_if "Root key not found"
"$KDB" export "$ROOT" "$PLUGIN" > "$DATADIR"/one_value."$PLUGIN"
succeed_if "Could not run kdb export"
test "$("$KDB" set "$ROOT"/key "value")" = "Create a new key $ROOT/key with string \"value\""
succeed_if "Could not set $ROOT/key"
"$KDB" export "$ROOT" "$PLUGIN" > "$DATADIR"/two_value."$PLUGIN"
succeed_if "Could not run kdb export"
"$KDB" set "$ROOT"/key/subkey "another value" > /dev/null
succeed_if "Could not set $ROOT/key/subkey"
"$KDB" export "$ROOT" "$PLUGIN" > "$DATADIR"/three_value."$PLUGIN"
succeed_if "Could not run kdb export"
"$KDB" rm "$ROOT"/key > /dev/null
succeed_if "Could not rm $ROOT/key"
"$KDB" export "$ROOT" "$PLUGIN" > "$DATADIR"/again_two_value."$PLUGIN"
succeed_if "Could not run kdb export"
"$KDB" rm -r "$ROOT"
succeed_if "Could not remove root"
done
end_script