Skip to content

Commit

Permalink
Merge pull request #56 from vrothberg/fix-rawhide
Browse files Browse the repository at this point in the history
go build: use `-mod=vendor` for go >= 1.11.x
  • Loading branch information
vrothberg authored Aug 2, 2019
2 parents 0729b3f + 1559bde commit eab23c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ before_install:
- sudo apt-get install -qq bats

script:
- make validate || travis_terminate 1
- make build || travis_terminate 1
- make test || travis_terminate 1
- make validate
- make build
- make test
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ PROJECT := github.com/containers/psgo
BATS_TESTS := *.bats
GO_SRC=$(shell find . -name \*.go)

GO_BUILD=$(GO) build
# Go module support: set `-mod=vendor` to use the vendored sources
ifeq ($(shell go help mod >/dev/null 2>&1 && echo true), true)
GO_BUILD=GO111MODULE=on $(GO) build -mod=vendor
endif

all: validate build

.PHONY: build
build: $(GO_SRC)
$(GO) build -buildmode=pie -o $(BUILD_DIR)/$(NAME) $(PROJECT)/sample
$(GO_BUILD) -buildmode=pie -o $(BUILD_DIR)/$(NAME) $(PROJECT)/sample

.PHONY: clean
clean:
Expand Down
11 changes: 7 additions & 4 deletions test/join.bats
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,20 @@ function is_podman_available() {
}

@test "Test fill-mappings" {
if [[ ! -z "$TRAVIS" ]]; then
skip "Travis doesn't like this test"
fi

run unshare -muinpfr --mount-proc true
if [[ "$status" -ne 0 ]]; then
skip "unshare doesn't support all the needed options"
fi

INTERVAL=10$RANDOM
unshare -muinpfr --mount-proc sleep $INTERVAL &
unshare -muinpfr --mount-proc sleep 20 &

PID=$(pgrep -fa $INTERVAL | grep -v unshare | cut -f 1 -d ' ')
PID=$(echo $!)
run nsenter --preserve-credentials -U -t $PID ./bin/psgo -pids $PID -join -fill-mappings -format huser
kill -9 $PID
[ "$status" -eq 0 ]
[[ ${lines[0]} != "root" ]]
kill -9 $PID
}

0 comments on commit eab23c5

Please sign in to comment.