From b7967864aa1da0876e2193b754c16e63918715ce Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 20 Jan 2017 13:08:15 -0500 Subject: [PATCH] cli.test: failing test on stdin manifest behavior ought to be, when `-f ` is not provided, then expect the manifest to be provided on stdin. Currently gomtree just fails if there is no `-f` (and it is not `-c`) Signed-off-by: Vincent Batts --- test/cli/0008.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/cli/0008.sh diff --git a/test/cli/0008.sh b/test/cli/0008.sh new file mode 100644 index 0000000..b32d43e --- /dev/null +++ b/test/cli/0008.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +name=$(basename $0) +root="$(dirname $(dirname $(dirname $0)))" +gomtree=$(readlink -f ${root}/gomtree) +t=$(mktemp -d /tmp/go-mtree.XXXXXX) + +echo "[${name}] Running in ${t}" + +pushd ${root} +mkdir -p ${t}/extract +git archive --format=tar HEAD^{tree} . | tar -C ${t}/extract/ -x + +${gomtree} -K sha256digest -c -p ${t}/extract/ > ${t}/${name}.mtree + +## This is a use-case for checking a directory, but by reading the manifest from stdin +## since the `-f` flag is not provided. +cat ${t}/${name}.mtree | ${gomtree} -p ${t}/extract/ + +popd +rm -rf ${t}