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
This commit is contained in:
Ian Wienand 2016-03-01 15:09:50 +11:00
parent 00abbf282a
commit 2badcc1893
2 changed files with 21 additions and 0 deletions

View File

@ -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:

View File

@ -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