Debian Codegraph @

tests/f/cylc-list/00-options.t

raw
1 #!/usr/bin/env bash
2 # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
3 # Copyright (C) NIWA & British Crown (Met Office) & Contributors.
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #------------------------------------------------------------------------------
18 # Test various uses of the cylc list command
19 . "$(dirname "$0")/test_header"
20 #------------------------------------------------------------------------------
21 set_test_number 10
22 #------------------------------------------------------------------------------
23 install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}"
24 #------------------------------------------------------------------------------
25 TEST_NAME="${TEST_NAME_BASE}-val"
26 run_ok "${TEST_NAME}" cylc validate "${WORKFLOW_NAME}"
27 #------------------------------------------------------------------------------
28 TEST_NAME=${TEST_NAME_BASE}-basic
29 cylc list "${WORKFLOW_NAME}" > list.out
30 cmp_ok list.out << __DONE__
31 cujo
32 fido
33 manny
34 __DONE__
35 #------------------------------------------------------------------------------
36 TEST_NAME=${TEST_NAME_BASE}-opt-a
37 cylc ls -a "${WORKFLOW_NAME}" > list-a.out
38 cmp_ok list-a.out << __DONE__
39 cujo
40 fido
41 manny
42 not-used
43 __DONE__
44 #------------------------------------------------------------------------------
45 TEST_NAME=${TEST_NAME_BASE}-opt-n
46 cylc list -n "${WORKFLOW_NAME}" > list-n.out
47 cmp_ok list-n.out << __DONE__
48 DOG
49 FICTIONAL
50 MAMMAL
51 POODLE
52 cujo
53 fido
54 manny
55 not-used
56 root
57 __DONE__
58 #------------------------------------------------------------------------------
59 TEST_NAME=${TEST_NAME_BASE}-opt-nw
60 cylc ls -nw "${WORKFLOW_NAME}" > list-nw.out
61 cmp_ok list-nw.out << __DONE__
62 DOG a canid that is known as man's best friend
63 FICTIONAL something made-up
64 MAMMAL a clade of endothermic amniotes
65 POODLE a ridiculous-looking dog owned by idiots
66 cujo a fearsome man-eating poodle
67 fido a large black and white spotted dog
68 manny a large hairy mammoth
69 not-used an unused namespace
70 root
71 __DONE__
72 #------------------------------------------------------------------------------
73 TEST_NAME=${TEST_NAME_BASE}-opt-nm
74 cylc list -nm "${WORKFLOW_NAME}" > list-nm.out
75 cmp_ok list-nm.out << __DONE__
76 DOG DOG MAMMAL root
77 FICTIONAL FICTIONAL root
78 MAMMAL MAMMAL root
79 POODLE POODLE DOG MAMMAL root
80 cujo cujo POODLE DOG MAMMAL FICTIONAL root
81 fido fido DOG MAMMAL root
82 manny manny MAMMAL FICTIONAL root
83 not-used not-used root
84 root root
85 __DONE__
86 #------------------------------------------------------------------------------
87 cat > res.out << __DONE__
88 20140808T0000Z/cujo
89 20140808T0000Z/fido
90 20140808T0000Z/manny
91 20140809T0000Z/cujo
92 20140809T0000Z/fido
93 20140809T0000Z/manny
94 20140810T0000Z/cujo
95 20140810T0000Z/fido
96 20140810T0000Z/manny
97 20140811T0000Z/cujo
98 20140811T0000Z/fido
99 20140811T0000Z/manny
100 20140812T0000Z/cujo
101 20140812T0000Z/fido
102 20140812T0000Z/manny
103 __DONE__
104
105 TEST_NAME=${TEST_NAME_BASE}-opt-p1
106 cylc ls -p 20140808T0000Z,20140812T0000Z "${WORKFLOW_NAME}" > list-p1.out
107 cmp_ok list-p1.out res.out
108
109 TEST_NAME=${TEST_NAME_BASE}-opt-p2
110 # default from initial point
111 cylc ls -p ,20140812T0000Z "${WORKFLOW_NAME}" > list-p2.out
112 cmp_ok list-p2.out res.out
113
114 cat > res2.out << __DONE__
115 20140808T0000Z/cujo
116 20140808T0000Z/fido
117 20140808T0000Z/manny
118 20140809T0000Z/cujo
119 20140809T0000Z/fido
120 20140809T0000Z/manny
121 20140810T0000Z/cujo
122 20140810T0000Z/fido
123 20140810T0000Z/manny
124 __DONE__
125
126
127 TEST_NAME=${TEST_NAME_BASE}-opt-p3
128 cylc ls -p 20140808T0000Z, "${WORKFLOW_NAME}" > list-p3.out
129 # default 3 cycle points
130 cmp_ok list-p3.out res2.out
131
132 TEST_NAME=${TEST_NAME_BASE}-opt-p4
133 cylc ls -p , "${WORKFLOW_NAME}" > list-p4.out
134 # default 3 cycle points from initial
135 cmp_ok list-p4.out res2.out
136 #------------------------------------------------------------------------------
137 purge