-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsimpletest.sh
More file actions
executable file
·54 lines (44 loc) · 1.26 KB
/
simpletest.sh
File metadata and controls
executable file
·54 lines (44 loc) · 1.26 KB
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
#!/bin/sh
. `dirname $0`/simpletest_engine.sh
test_overall_workflow() {
export GOTO_FILE=`tempfile`
must goto-tool list
must goto-tool add foo /tmp
# Should work after adding the entry 'foo'.
must goto-tool use foo
must goto-tool get foo
# Test using several times to mimic normal behaviour.
must goto-tool use foo
must goto-tool use foo
must goto-tool use foo
# Delete foo and expect every command that accesses foo to fail.
must goto-tool rm foo
fail goto-tool get foo
fail goto-tool use foo
fail goto-tool use foo
# Should fail since there is no 'bar'.
fail goto-tool use bar
fail goto-tool rm bar
fail goto-tool get bar
# Switch GOTO_FILE to another file, entries should be different.
must goto-tool add foo /tmp
must goto-tool get foo
ALT_GOTO_FILE=`tempfile`
GOTO_FILE="$ALT_GOTO_FILE" fail goto-tool get foo
GOTO_FILE="$ALT_GOTO_FILE" must goto-tool add foo /tmp
GOTO_FILE="$ALT_GOTO_FILE" must goto-tool get foo
}
test_clean() {
# Simply invoking 'clean' should not raise exceptions
export GOTO_FILE=`tempfile`
must goto-tool clean
must goto-tool add foo /tmp
must goto-tool clean
must goto-tool add bar /tmp
must goto-tool clean
must goto-tool rm bar
must goto-tool clean
}
test_overall_workflow
test_clean
printok "Everything went well."