diskimage-builder/elements/apt-sources/test-elements/test-sources/pre-install.d/00-test-apt-sources
Gregory Haynes b9b6640fa7 Initial element tests
Adding a test function which allows us to use elements to perform
element-specific tests. In order for this to work sanely, also adding
some configuration to our break system so we can assert on negative
tests.

Also adding a test for apt-sources to verify this code actually works.

Change-Id: I378a74255010eca192f5766b653f8a42404be5ea
2015-05-17 02:07:40 +00:00

14 lines
256 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eux
set -o pipefail
echo "Verifying apt sources.list content"
[ -f /etc/apt/sources.list ]
[ "$(cat /etc/apt/sources.list)" = "testdata" ]
touch /tmp/dib-test-should-fail && exit 1