Skip to content

Commit ccadcb0

Browse files
Merge pull request #1059 from richm/rsyslog-fix-url-location
new location for node kubeconfig; dump rsyslog log at end of test
2 parents 0283510 + 78325ee commit ccadcb0

File tree

3 files changed

+36
-26
lines changed

3 files changed

+36
-26
lines changed

hack/testing/rsyslog/playbook.yaml

+5-8
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,17 @@
6565
- name: get k8s api url from node kubeconfig
6666
shell: |
6767
found=0
68-
for file in /etc/origin/node/system\:node\:*.kubeconfig ; do
68+
for file in /etc/origin/node/node*.kubeconfig \
69+
/etc/origin/node/system\:node\:*.kubeconfig \
70+
/var/lib/origin/openshift.local.config/node*/*.kubeconfig ; do
6971
if [ -f "$file" ] ; then
7072
oc --config="$file" config view -o jsonpath='{.clusters[0].cluster.server}'
7173
found=1
7274
break
7375
fi
7476
done
75-
if [ $found -eq 0 -a -d /var/lib/origin/openshift.local.config ] ; then
76-
for file in /var/lib/origin/openshift.local.config/node*/*.kubeconfig ; do
77-
if [ -f "$file" ] ; then
78-
oc --config="$file" config view -o jsonpath='{.clusters[0].cluster.server}'
79-
break
80-
fi
81-
done
77+
if [ $found -eq 0 ] ; then
78+
oc config view -o jsonpath='{.clusters[0].cluster.server}'
8279
fi
8380
register: k8s_api_url
8481
when:

test/remote-syslog.sh

+30-18
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ cleanup() {
7777
if [ "$fluentdtype" = "fluentd" ] ; then
7878
reset_fluentd_daemonset
7979
else
80-
os::log::debug "$( oc scale --replicas=0 dc logging-mux )"
80+
oc scale --replicas=0 dc logging-mux 2>&1 | artifact_out
8181
os::cmd::try_until_text "oc get dc logging-mux -o jsonpath='{ .status.replicas }'" "0" $MUX_WAIT_TIME
82-
os::log::debug "$( oc set env dc/logging-mux USE_REMOTE_SYSLOG=false REMOTE_SYSLOG_HOST- REMOTE_SYSLOG_USE_RECORD- REMOTE_SYSLOG_PORT=514 )"
83-
os::log::debug "$( oc scale --replicas=1 dc logging-mux )"
82+
oc set env dc/logging-mux USE_REMOTE_SYSLOG=false REMOTE_SYSLOG_HOST- REMOTE_SYSLOG_USE_RECORD- REMOTE_SYSLOG_PORT=514 2>&1 | artifact_out
83+
oc scale --replicas=1 dc logging-mux 2>&1 | artifact_out
8484
os::cmd::try_until_text "oc get pods -l component=mux" "^logging-mux-.* Running " $MUX_WAIT_TIME
8585

86-
os::log::debug "$( oc label node --all logging-infra-fluentd- )"
86+
oc label node --all logging-infra-fluentd- 2>&1 | artifact_out
8787
os::cmd::try_until_text "oc get daemonset logging-fluentd -o jsonpath='{ .status.numberReady }'" "0" $FLUENTD_WAIT_TIME
88-
os::log::debug "$( oc set env ds/logging-fluentd MUX_CLIENT_MODE- )"
89-
os::log::debug "$( oc label node --all logging-infra-fluentd=true --overwrite=true )"
88+
oc set env ds/logging-fluentd MUX_CLIENT_MODE- 2>&1 | artifact_out
89+
oc label node --all logging-infra-fluentd=true --overwrite=true 2>&1 | artifact_out
9090
os::cmd::try_until_text "oc get pods -l component=fluentd" "^logging-fluentd-.* Running "
9191
fi
9292

@@ -118,19 +118,25 @@ if [ -n "$my_remote_syslog_host" ]; then
118118
os::log::info $title
119119

120120
if [ "$fluentdtype" = "fluentd" ] ; then
121-
os::log::debug "$( oc label node --all logging-infra-fluentd- )"
121+
oc label node --all logging-infra-fluentd- 2>&1 | artifact_out
122122
os::cmd::try_until_text "oc get daemonset logging-fluentd -o jsonpath='{ .status.numberReady }'" "0" $FLUENTD_WAIT_TIME
123-
os::log::debug "$( oc set env ds/logging-fluentd USE_REMOTE_SYSLOG=true )"
124-
os::log::debug "$( oc label node --all logging-infra-fluentd=true --overwrite=true )"
123+
oc set env ds/logging-fluentd USE_REMOTE_SYSLOG=true 2>&1 | artifact_out
124+
oc label node --all logging-infra-fluentd=true --overwrite=true 2>&1 | artifact_out
125125
os::cmd::try_until_text "oc get pods -l component=fluentd" "^logging-fluentd-.* Running "
126126
mypod=$( get_running_pod fluentd )
127127
else
128128
# make sure mux is running after previous test
129129
os::cmd::try_until_text "oc get pods -l component=mux" "^logging-mux.* Running "
130-
os::log::debug "$( oc scale --replicas=0 dc logging-mux )"
130+
oc scale --replicas=0 dc logging-mux 2>&1 | artifact_out
131131
os::cmd::try_until_text "oc get dc logging-mux -o jsonpath='{ .status.replicas }'" "0" $MUX_WAIT_TIME
132-
os::log::debug "$( oc set env dc/logging-mux USE_REMOTE_SYSLOG=true )"
133-
os::log::debug "$( oc scale --replicas=1 dc logging-mux )"
132+
oc get pods | grep mux 2>&1 | artifact_out
133+
oc get dc 2>&1 | artifact_out
134+
oc set env dc/logging-mux USE_REMOTE_SYSLOG=true 2>&1 | artifact_out
135+
oc get pods | grep mux 2>&1 | artifact_out
136+
oc get dc 2>&1 | artifact_out
137+
oc scale --replicas=1 dc logging-mux 2>&1 | artifact_out
138+
oc get pods | grep mux 2>&1 | artifact_out
139+
oc get dc 2>&1 | artifact_out
134140
os::cmd::try_until_text "oc get pods -l component=mux" "^logging-mux-.* Running " $MUX_WAIT_TIME
135141
mypod=$( get_running_pod mux )
136142
fi
@@ -146,23 +152,29 @@ os::log::info $title
146152
if [ "$fluentdtype" = "fluentd" ] ; then
147153
# make sure fluentd is running after previous test
148154
os::cmd::try_until_text "oc get pods -l component=fluentd" "^logging-fluentd-.* Running "
149-
os::log::debug "$( oc label node --all logging-infra-fluentd- )"
155+
oc label node --all logging-infra-fluentd- 2>&1 | artifact_out
150156
os::cmd::try_until_text "oc get daemonset logging-fluentd -o jsonpath='{ .status.numberReady }'" "0" $FLUENTD_WAIT_TIME
151157

152158
# choosing an unrealistic REMOTE_SYSLOG_HOST
153-
os::log::debug "$( oc set env daemonset/logging-fluentd USE_REMOTE_SYSLOG=true REMOTE_SYSLOG_HOST=111.222.111.222 )"
154-
os::log::debug "$( oc label node --all logging-infra-fluentd=true --overwrite=true )"
159+
oc set env daemonset/logging-fluentd USE_REMOTE_SYSLOG=true REMOTE_SYSLOG_HOST=111.222.111.222 2>&1 | artifact_out
160+
oc label node --all logging-infra-fluentd=true --overwrite=true 2>&1 | artifact_out
155161
os::cmd::try_until_text "oc get pods -l component=fluentd" "^logging-fluentd-.* Running "
156162

157163
mypod=$( get_running_pod fluentd )
158164
else
159165
# make sure mux is running after previous test
160166
os::cmd::try_until_text "oc get pods -l component=mux" "^logging-mux.* Running "
161-
os::log::debug "$( oc scale --replicas=0 dc logging-mux )"
167+
oc scale --replicas=0 dc logging-mux 2>&1 | artifact_out
162168
os::cmd::try_until_text "oc get dc logging-mux -o jsonpath='{ .status.replicas }'" "0" $MUX_WAIT_TIME
163169
# choosing an unrealistic REMOTE_SYSLOG_HOST
164-
os::log::debug "$( oc set env dc/logging-mux USE_REMOTE_SYSLOG=true REMOTE_SYSLOG_HOST=111.222.111.222 )"
165-
os::log::debug "$( oc scale --replicas=1 dc logging-mux )"
170+
oc get pods | grep mux 2>&1 | artifact_out
171+
oc get dc 2>&1 | artifact_out
172+
oc set env dc/logging-mux USE_REMOTE_SYSLOG=true REMOTE_SYSLOG_HOST=111.222.111.222 2>&1 | artifact_out
173+
oc get pods | grep mux 2>&1 | artifact_out
174+
oc get dc 2>&1 | artifact_out
175+
oc scale --replicas=1 dc logging-mux 2>&1 | artifact_out
176+
oc get pods | grep mux 2>&1 | artifact_out
177+
oc get dc 2>&1 | artifact_out
166178
os::cmd::try_until_text "oc get pods -l component=mux" "^logging-mux-.* Running " $MUX_WAIT_TIME
167179

168180
mypod=$( get_running_pod mux )

test/zzz-rsyslog.sh

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ cleanup() {
1919
if [ -n "${tmpinv}" -a -f "${tmpinv}" ] ; then
2020
rm -f $tmpinv
2121
fi
22+
sudo journalctl -u rsyslog --since="-1hour" > $ARTIFACT_DIR/rsyslog-rsyslog.log 2>&1
2223
if [ -n "${rsyslog_save}" -a -d "${rsyslog_save}" ] ; then
2324
sudo rm -rf /etc/rsyslog.d/*
2425
sudo cp -p ${rsyslog_save}/* /etc/rsyslog.d

0 commit comments

Comments
 (0)