Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.PHONY: dbuild man
.PHONY: dbuild man \
localtest localunittest localintegration \
test unittest integration

RUNC_IMAGE := runc_dev
RUNC_TEST_IMAGE := runc_test
Expand All @@ -25,6 +27,12 @@ static: $(RUNC_LINK)
$(RUNC_LINK):
ln -sfn $(CURDIR) $(RUNC_LINK)

dbuild: runctestimage
docker build -t $(RUNC_IMAGE) .
docker create --name=$(RUNC_INSTANCE) $(RUNC_IMAGE)
docker cp $(RUNC_INSTANCE):$(RUNC_BUILD_PATH) .
docker rm $(RUNC_INSTANCE)

lint:
go vet ./...
go fmt ./...
Expand All @@ -35,24 +43,24 @@ man:
runctestimage:
docker build -t $(RUNC_TEST_IMAGE) -f $(TEST_DOCKERFILE) .

test: runctestimage
docker run -e TESTFLAGS -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localtest
test:
make unittest integration

localtest: all
go test -tags "$(BUILDTAGS)" ${TESTFLAGS} -v ./...
localtest:
make localunittest localintegration

dbuild: runctestimage
docker build -t $(RUNC_IMAGE) .
docker create --name=$(RUNC_INSTANCE) $(RUNC_IMAGE)
docker cp $(RUNC_INSTANCE):$(RUNC_BUILD_PATH) .
docker rm $(RUNC_INSTANCE)
unittest: runctestimage
docker run -e TESTFLAGS -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localunittest

localunittest: all
go test -tags "$(BUILDTAGS)" ${TESTFLAGS} -v ./...

integration: runctestimage
docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localintegration

localintegration:
bats tests/integration${TESTFLAGS}
localintegration: all
bats -t tests/integration${TESTFLAGS}

install:
install -D -m0755 runc /usr/local/sbin/runc

Expand Down
9 changes: 4 additions & 5 deletions script/test_Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y \
python-minimal \
--no-install-recommends

# install bats
# install bats
RUN cd /tmp \
&& git clone https://github.com/sstephenson/bats.git \
&& cd bats \
Expand All @@ -33,10 +33,9 @@ RUN mkdir -p /usr/src/criu \
&& make install-criu

# setup a playground for us to spawn containers in
RUN mkdir /busybox \
&& mkdir /testdata \
&& curl -o /testdata/busybox.tar -sSL 'https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.11/rootfs.tar' \
&& tar -C /busybox -xf /testdata/busybox.tar
ENV ROOTFS /busybox
RUN mkdir -p ${ROOTFS} \
&& curl -o- -sSL 'https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.11/rootfs.tar' | tar -C ${ROOTFS} -xf -

COPY script/tmpmount /
WORKDIR /go/src/github.com/opencontainers/runc
Expand Down