File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ run_test () {
3
+ local name=$1
4
+ local node=$2
5
+ local script=$3
6
+ echo " ==== test: $1 (node: $2 ) ===="
7
+
8
+ local expected=" $( mktemp) "
9
+ local got=" $( mktemp) "
10
+
11
+ if diff --strip-trailing-cr -u <( sh -c " $script " ) <( set -x; ./kubectl-node_shell $node -- sh -c " $script " ) ; then
12
+ echo -e " Result: \e[42mPASS\e[49m"
13
+ else
14
+ echo -e " Result: \e[101mFAIL\e[49m"
15
+ fi
16
+ }
17
+
18
+ if [ -z $1 ]; then
19
+ echo " please specify node in first argument" >&2
20
+ exit -1
21
+ fi
22
+
23
+ case1=$( cat << \EOT
24
+ echo $( echo "
25
+ hello everybody
26
+ I'm a \" baby seal\" "
27
+
28
+ )
29
+ EOT
30
+ )
31
+
32
+ case2=$( cat << \EOT
33
+
34
+ echo "ggg
35
+
36
+
37
+ ttt"
38
+ EOT
39
+ )
40
+
41
+ case3=$( cat << \EOT
42
+ echo $( echo "
43
+ hello everybody
44
+ I'm a \" baby seal
45
+
46
+ really really
47
+
48
+ \" "
49
+ )
50
+ EOT
51
+ )
52
+
53
+ run_test " case 1" " $1 " " $case1 "
54
+ run_test " case 2" " $1 " " $case2 "
55
+ run_test " case 3" " $1 " " $case3 "
You can’t perform that action at this time.
0 commit comments