From 8a6053a104be76704bac730660e3bc9afda2e9d7 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 26 May 2017 16:49:53 +0200 Subject: [PATCH] MT#16391 Initial autopkgtest test Make sure ngcpcfg binary is available and installed appropriately for execution. Provide placeholder files for the configuration files that are needed for ngcpcfg execution. This serves as a starting point for further system tests during Debian package build time. Change-Id: I70dca5e4bed6a896f31c3a3eb909da17e496fc92 --- debian/tests/basic-binary | 21 +++++++++++++++++++++ debian/tests/control | 1 + 2 files changed, 22 insertions(+) create mode 100644 debian/tests/basic-binary create mode 100644 debian/tests/control diff --git a/debian/tests/basic-binary b/debian/tests/basic-binary new file mode 100644 index 00000000..a544cc92 --- /dev/null +++ b/debian/tests/basic-binary @@ -0,0 +1,21 @@ +#!/bin/sh + +set -eu + +if ! ngcpcfg 2>&1 | grep -q 'Error: Configuration file' ; then + echo "Error: ngcpcfg doesn't detect missing configuration file(s)." >&2 + ngcpcfg + exit 1 +fi + +touch /etc/ngcp-config/config.yml +touch /etc/ngcp-config/constants.yml +touch /etc/ngcp-config/network.yml + +mkdir /etc/ngcp-config/templates + +if ! ngcpcfg 2>&1 | grep -q 'Usage: ngcpcfg' ; then + echo "ngcpcfg usage information not displayed:" >&2 + ngcpcfg + exit 1 +fi diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 00000000..54cd8f72 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1 @@ +Tests: basic-binary