|
@@ -1,245 +0,0 @@
|
1
|
|
-#!/bin/bash
|
2
|
|
-
|
3
|
|
-. <(ffoom init)
|
4
|
|
-FFOO_INI_PATH="__FFOO_INI_PATH__"
|
5
|
|
-
|
6
|
|
-ffoo import core
|
7
|
|
-ffoo import ini
|
8
|
|
-ffoo import proj_ol
|
9
|
|
-ffoo import testing
|
10
|
|
-ffoo import sw
|
11
|
|
-ffoo import yummy
|
12
|
|
-
|
13
|
|
-ENVIRON_SCRIPT="$HOME/.eemk-env"
|
14
|
|
-FFOO_VERBOSE=true
|
15
|
|
-OL_TRY_JM=${OL_TRY_JM:-false}
|
16
|
|
-TEST_STATUS=0
|
17
|
|
-
|
18
|
|
-# tmp needs to be shared to children
|
19
|
|
-if test -d "$TMP_DIR";
|
20
|
|
-then # we must be child
|
21
|
|
- THIS_IS_CHILD=true
|
22
|
|
-else # we are top parent; need some setup
|
23
|
|
- THIS_IS_CHILD=false
|
24
|
|
- export TMP_DIR="$(mktemp -d)"
|
25
|
|
-fi
|
26
|
|
-
|
27
|
|
-[ "$(whoami)" == "root" ] || die "you need to be root"
|
28
|
|
-
|
29
|
|
-yum_install_if_needed wget
|
30
|
|
-
|
31
|
|
-fc22plus() {
|
32
|
|
- test "$(guess_rtag_word)" == "fc" -a 0$(guess_rtag_num) -ge 22
|
33
|
|
-}
|
34
|
|
-
|
35
|
|
-maybe_with_jobmanager() {
|
36
|
|
- debug -v OL_TRY_JM
|
37
|
|
- debug -c fc22plus
|
38
|
|
- if $OL_TRY_JM || fc22plus;
|
39
|
|
- then
|
40
|
|
- echo -DWITH-JOBMANAGER=1
|
41
|
|
- else
|
42
|
|
- echo -DWITH-JOBMANAGER=0
|
43
|
|
- fi
|
44
|
|
-}
|
45
|
|
-
|
46
|
|
-case "$1" in
|
47
|
|
-
|
48
|
|
-
|
49
|
|
- ## ------ ##
|
50
|
|
- ## COMMON ##
|
51
|
|
- ## ------ ##
|
52
|
|
-
|
53
|
|
- abrtbz)
|
54
|
|
- think "Updating abrt to internal version"
|
55
|
|
- save_repo_for abrtbz
|
56
|
|
- yum_update "abrt"
|
57
|
|
- ;;
|
58
|
|
-
|
59
|
|
- sl0)
|
60
|
|
- think "Turning off SELinux"
|
61
|
|
- setenforce 0
|
62
|
|
- sed -i~ -e 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
|
63
|
|
- ;;
|
64
|
|
-
|
65
|
|
-
|
66
|
|
- ## ------- ##
|
67
|
|
- ## OPENLMI ##
|
68
|
|
- ## ------- ##
|
69
|
|
-
|
70
|
|
- ## setup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ##
|
71
|
|
-
|
72
|
|
- olbrc)
|
73
|
|
- LMI_CIMOM_PORT=5989
|
74
|
|
- mkdir -p "$(dirname $ENVIRON_SCRIPT)"
|
75
|
|
- think "Adding ol environment script $ENVIRON_SCRIPT to .bashrc"
|
76
|
|
- {
|
77
|
|
- # warning: only echo if not login shell or rsync will freak out
|
78
|
|
- echo "shopt -q login_shell && echo setting up ol environment variables"
|
79
|
|
- echo "export LMI_ACCOUNT_USER='account_test_user'"
|
80
|
|
- echo "export LMI_ACCOUNT_GROUP='account_test_group'"
|
81
|
|
- echo "export LMI_CIMOM_URL='https://${HOSTNAME}:$LMI_CIMOM_PORT'"
|
82
|
|
- echo "export LMI_CIMOM_USERNAME='pegasus'"
|
83
|
|
- echo "export LMI_CIMOM_PASSWORD='blank'"
|
84
|
|
- echo "export LMI_CIMOM_BROKER='tog-pegasus'"
|
85
|
|
- echo "export LMI_RUN_DANGEROUS='1'"
|
86
|
|
- echo "export LMI_IND_LISTENER_PORT='15000'"
|
87
|
|
- echo "export PYTHONPATH='$PYTHONPATH:$PWD/openlmi-providers/src/python'"
|
88
|
|
- } > $ENVIRON_SCRIPT
|
89
|
|
- append_if_missing \
|
90
|
|
- "test -f $ENVIRON_SCRIPT && . $ENVIRON_SCRIPT" \
|
91
|
|
- /root/.bashrc
|
92
|
|
- ;;
|
93
|
|
-
|
94
|
|
- olconfig)
|
95
|
|
- $0 sl0
|
96
|
|
- think "Bypassing SSL verification"
|
97
|
|
- echo "127.0.0.1 $(hostname)" >> /etc/hosts
|
98
|
|
- service tog-pegasus start # to generate server.pem
|
99
|
|
- service tog-pegasus stop
|
100
|
|
- cp "/etc/Pegasus/server.pem" \
|
101
|
|
- "/etc/pki/ca-trust/source/anchors/remote-server.pem"
|
102
|
|
- update-ca-trust
|
103
|
|
- think "Setting pegasus password"
|
104
|
|
- echo "pegasus:blank" | chpasswd
|
105
|
|
- $0 olbrc
|
106
|
|
- ;;
|
107
|
|
-
|
108
|
|
- ## runtime - - - - - - - - - - - - - - - - - - - - - - - - - - - - ##
|
109
|
|
-
|
110
|
|
- olenv)
|
111
|
|
- . $ENVIRON_SCRIPT
|
112
|
|
- ;;
|
113
|
|
-
|
114
|
|
- olcs)
|
115
|
|
- think "Starting a simple cimserver ($(comment_cimserver))"
|
116
|
|
- start_cimserver
|
117
|
|
- ;;
|
118
|
|
-
|
119
|
|
- olrun*)
|
120
|
|
- $0 olcs
|
121
|
|
- $0 olenv
|
122
|
|
- iniread -p mk.run.what.$2 mk-ol.ini \
|
123
|
|
- | while read path;
|
124
|
|
- do
|
125
|
|
- pushd "$(dirname $path)";
|
126
|
|
- nosetests --nocapture -v "$(basename $path)"
|
127
|
|
- es=$?
|
128
|
|
- test $es -gt 0$TEST_STATUS && TEST_STATUS=$es
|
129
|
|
- popd
|
130
|
|
- done
|
131
|
|
- stop_cimserver
|
132
|
|
- ;;
|
133
|
|
-
|
134
|
|
- olmk*)
|
135
|
|
- # let's build *anything*
|
136
|
|
- case $2 in
|
137
|
|
- p|openlmi-providers)
|
138
|
|
- (
|
139
|
|
- mkdir -p openlmi-providers/build
|
140
|
|
- cd openlmi-providers/build
|
141
|
|
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
|
142
|
|
- -DWITH-FAN=0 \
|
143
|
|
- -DWITH-POWER=0 \
|
144
|
|
- -DWITH-SSSD=0 \
|
145
|
|
- $(maybe_with_jobmanager)
|
146
|
|
- make
|
147
|
|
- make doc
|
148
|
|
- make install
|
149
|
|
- make register-Service
|
150
|
|
- )
|
151
|
|
- ;;
|
152
|
|
- t|openlmi-tools)
|
153
|
|
- (
|
154
|
|
- cd openlmi-tools/cli
|
155
|
|
- make clean
|
156
|
|
- make
|
157
|
|
- python setup.py install || die "could not install openlmi-tools"
|
158
|
|
- make clean
|
159
|
|
- )
|
160
|
|
- ;;
|
161
|
|
- *)
|
162
|
|
- die "don't know how to build: $2"
|
163
|
|
- ;;
|
164
|
|
- esac
|
165
|
|
- ;;
|
166
|
|
-
|
167
|
|
- olyum)
|
168
|
|
- save_repo_for openlmi-scripts
|
169
|
|
- think "Installing OpenLMI software"
|
170
|
|
- iniread -s mk.requires.sut mk-ol.ini | any_install
|
171
|
|
- think "Installing testing tools"
|
172
|
|
- iniread -s mk.requires.test mk-ol.ini | any_install
|
173
|
|
- ;;
|
174
|
|
-
|
175
|
|
- OL)
|
176
|
|
- $0 olyum
|
177
|
|
- $0 olconfig
|
178
|
|
- ;;
|
179
|
|
-
|
180
|
|
- OLB)
|
181
|
|
- think "Installing build dependencies"
|
182
|
|
- iniread -s mk.requires.build mk-ol.ini | any_install
|
183
|
|
- ;;
|
184
|
|
-
|
185
|
|
-
|
186
|
|
- ## --------- ##
|
187
|
|
- ## BEAKERLIB ##
|
188
|
|
- ## --------- ##
|
189
|
|
-
|
190
|
|
- bkrund)
|
191
|
|
- TERM=xterm reset
|
192
|
|
- pushd "proj/$2"
|
193
|
|
- make run > 1
|
194
|
|
- es=$?
|
195
|
|
- test $es -gt 0$TEST_STATUS && TEST_STATUS=$es
|
196
|
|
- popd
|
197
|
|
- ;;
|
198
|
|
-
|
199
|
|
- bkrun)
|
200
|
|
- pushd "proj/$2"
|
201
|
|
- make run
|
202
|
|
- es=$?
|
203
|
|
- test $es -gt 0$TEST_STATUS && TEST_STATUS=$es
|
204
|
|
- popd
|
205
|
|
- ;;
|
206
|
|
-
|
207
|
|
- ## rpmwork - - - - - - - - - - - - - - - - - - - - - - - - - - - - ##
|
208
|
|
-
|
209
|
|
- rpmso)
|
210
|
|
- path=rpms/old/`arch`
|
211
|
|
- think "Deploying old RPMs from $path"
|
212
|
|
- guess_pkgnames $path | yum_preerase
|
213
|
|
- yum_install $path/*
|
214
|
|
- guess_pkgnames $path | installed_versions
|
215
|
|
- ;;
|
216
|
|
-
|
217
|
|
- rpmsn)
|
218
|
|
- path=rpms/new/`arch`
|
219
|
|
- think "Deploying new RPMs from $path"
|
220
|
|
- guess_pkgnames $path | yum_preerase
|
221
|
|
- yum_install $path/*
|
222
|
|
- guess_pkgnames $path | installed_versions
|
223
|
|
- ;;
|
224
|
|
-
|
225
|
|
- RH)
|
226
|
|
- save_repo_for beakerlib
|
227
|
|
- save_repo_for rhpkg
|
228
|
|
- save_repo_for beakerlib-redhat
|
229
|
|
- think "Installing system under test"
|
230
|
|
- iniread -s mk.requires.sut mk-bk.ini | any_install
|
231
|
|
- think "Installing testing tools"
|
232
|
|
- iniread -s mk.requires.test mk-bk.ini | any_install
|
233
|
|
- ;;
|
234
|
|
-
|
235
|
|
- *)
|
236
|
|
- usage_is "TARGET"
|
237
|
|
-
|
238
|
|
-esac
|
239
|
|
-
|
240
|
|
-if ! $THIS_IS_CHILD;
|
241
|
|
-then
|
242
|
|
- collect_artifacts -s artifacts
|
243
|
|
- rm -rf $TMP_DIR
|
244
|
|
-fi
|
245
|
|
-exit $TEST_STATUS
|