Skip to content

Commit 39be413

Browse files
author
Matthew Fisher
committed
Merge pull request #3350 from aledbf/extract_app_journal_logs
feat(test): remove hardcoded names. Extract journal logs from each app
2 parents ca66400 + 0182052 commit 39be413

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

tests/bin/test-setup.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,11 @@ function dump_logs {
100100
export FLEETCTL_TUNNEL=$DEISCTL_TUNNEL
101101
fleetctl -strict-host-key-checking=false list-units
102102
# application unit logs
103-
get_logs appssample_v2.web.1
104-
get_logs appssample_v2.run.1
105-
get_logs buildsample_v2.web.1
106-
get_logs buildsample_v3.cmd.1
107-
get_logs deispullsample_v2.cmd.1
108-
get_logs deispullsample_v2.worker.1
109-
get_logs pssample_v2.worker.1
110-
get_logs pssample_v2.worker.2
103+
for APP in `fleetctl -strict-host-key-checking=false list-units --no-legend --fields=unit | grep -v "deis-"`;do
104+
CURRENT_APP=$(echo $APP | sed "s/\.service//")
105+
#echo "$CURRENT_APP"
106+
get_journal_logs $CURRENT_APP
107+
done
111108
# etcd keyspace
112109
get_logs deis-controller "etcdctl ls / --recursive" etcdctl-dump
113110
# component logs
@@ -170,3 +167,8 @@ function get_logs {
170167
fi
171168
fleetctl -strict-host-key-checking=false ssh "$TARGET" docker logs "$CONTAINER" > $FAILED_LOGS_DIR/$FILENAME.log
172169
}
170+
171+
function get_journal_logs {
172+
TARGET="$1"
173+
fleetctl -strict-host-key-checking=false journal --lines=1000 "$TARGET" > $FAILED_LOGS_DIR/$TARGET.log
174+
}

0 commit comments

Comments
 (0)