From 2badcc1893adbf065b2f3b0a85e120e28c6f44c0 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 1 Mar 2016 15:09:50 +1100 Subject: [PATCH] Add a dib-builddate file Add a build-date timestamp file to the nodepool-base element and output that as part of the "network-info" macro that we run at the start of most tests. This will allow non-priviledged users to quickly see the date the node running their test was built on, which can be correlated to the logs on nodepool.openstack.org to help debug issues that might have to do with the underlying image build. Change-Id: Id0c9f6203ed487350285031d3965bc6290370a27 --- jenkins/jobs/macros.yaml | 9 +++++++++ .../nodepool-base/install.d/06-record-builddate | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 nodepool/elements/nodepool-base/install.d/06-record-builddate diff --git a/jenkins/jobs/macros.yaml b/jenkins/jobs/macros.yaml index e3a0ae8efb..bb9437ee86 100644 --- a/jenkins/jobs/macros.yaml +++ b/jenkins/jobs/macros.yaml @@ -593,14 +593,23 @@ - shell: | #!/bin/sh export PATH=$PATH:/sbin + if [ -f /etc/dib-builddate.txt ]; then + echo "Image build date" + echo "================" + cat /etc/dib-builddate.txt + fi echo "Host & kernel" + echo "=============" uname -a echo "Network interface addresses..." + echo "==============================" ip address show echo "Network routing tables..." + echo "=========================" ip route show ip -6 route show echo "Network neighbors..." + echo "====================" ip neighbor show - builder: diff --git a/nodepool/elements/nodepool-base/install.d/06-record-builddate b/nodepool/elements/nodepool-base/install.d/06-record-builddate new file mode 100755 index 0000000000..9db66e785e --- /dev/null +++ b/nodepool/elements/nodepool-base/install.d/06-record-builddate @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +# Put a timestamp in the image file of the date the image was built. +# This is echoed into the logs on each run for easy cross-reference + +date --utc "+%Y-%m-%d %H:%M" > /etc/dib-builddate.txt