Update spec test to use go.mod

Signed-off-by: Odin Ugedal <odin@ugedal.com>
This commit is contained in:
Odin Ugedal 2019-06-18 19:15:26 +02:00
parent 69e8fb2a74
commit 382735469c
No known key found for this signature in database
GPG Key ID: AFF9C8242CF7A7AF
1 changed files with 8 additions and 2 deletions

View File

@ -72,8 +72,14 @@ function teardown() {
run git clone https://github.com/opencontainers/runtime-spec.git src/runtime-spec
[ "$status" -eq 0 ]
SPEC_COMMIT=$(grep '^github.com/opencontainers/runtime-spec' ${TESTDIR}/../../vendor.conf | tr -s ' ' | cut -d ' ' -f 2)
run git -C src/runtime-spec reset --hard "${SPEC_COMMIT}"
SPEC_VERSION=$(grep 'github.com/opencontainers/runtime-spec' ${TESTDIR}/../../go.mod | cut -d ' ' -f 2)
# Will look like this when not pinned to spesific tag: "v0.0.0-20190207185410-29686dbc5559", otherwise "v1.0.0"
SPEC_COMMIT=$(cut -d "-" -f 3 <<< $SPEC_VERSION)
SPEC_REF=$([[ -z "$SPEC_COMMIT" ]] && echo $SPEC_VERSION || echo $SPEC_COMMIT)
run git -C src/runtime-spec reset --hard "${SPEC_REF}"
[ "$status" -eq 0 ]
[ -e src/runtime-spec/schema/config-schema.json ]