diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7b18cfc..ce8bbc9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -65,6 +65,7 @@ jobs: cp ./bin/atomfs atomfs-${{ matrix.os }} - name: test run: | + make debugidmaps make batstest - name: Upload code coverage uses: codecov/codecov-action@v4 diff --git a/Makefile b/Makefile index 9c6476c..f99e2fb 100644 --- a/Makefile +++ b/Makefile @@ -31,46 +31,45 @@ atomfs: .made-gofmt $(GO_SRC) gotest: $(GO_SRC) go test -coverprofile=coverage.txt -ldflags "$(VERSION_LDFLAGS)" ./... -.ONESHELL: $(STACKER): - set -e; rm -rf stacker-git; - mkdir -p $(TOOLS_D)/bin; - cd $(TOOLS_D)/bin + mkdir -p $(TOOLS_D)/bin wget --progress=dot:giga https://github.com/project-stacker/stacker/releases/download/$(STACKER_VERSION)/stacker chmod +x stacker + cp stacker $(TOOLS_D)/bin/ -.ONESHELL: $(BATS): - set -ex - rm -rf bats-core mkdir -p $(TOOLS_D)/bin git clone -b $(BATS_VERSION) https://github.com/bats-core/bats-core.git - cd bats-core - ./install.sh $(TOOLS_D) - cd .. - rm -rf bats-core - mkdir -p test/test_helper - git clone --depth 1 https://github.com/bats-core/bats-support test/test_helper/bats-support - git clone --depth 1 https://github.com/bats-core/bats-assert test/test_helper/bats-assert - git clone --depth 1 https://github.com/bats-core/bats-file test/test_helper/bats-file + cd bats-core; ./install.sh $(TOOLS_D) + mkdir -p $(ROOT)/test/test_helper + git clone --depth 1 https://github.com/bats-core/bats-support $(ROOT)/test/test_helper/bats-support + git clone --depth 1 https://github.com/bats-core/bats-assert $(ROOT)/test/test_helper/bats-assert + git clone --depth 1 https://github.com/bats-core/bats-file $(ROOT)/test/test_helper/bats-file -.ONESHELL: batstest: $(BATS) $(STACKER) atomfs test/random.txt - set -ex - cd $(ROOT)/test - sudo $(BATS) --tap --timing *.bats + cd $(ROOT)/test; sudo $(BATS) --tap --timing *.bats -.ONESHELL: test/random.txt: - cd test - dd if=/dev/random of=/dev/stdout count=2048 | base64 > random.txt + dd if=/dev/random of=/dev/stdout count=2048 | base64 > test/random.txt .PHONY: test toolsclean test: gotest batstest +debugidmaps: + echo /etc/subuid + cat /etc/subuid + echo /etc/subgid + cat /etc/subgid + u=$(id -un) && g=$(id -gn) + echo "u=$u g=$g" + echo "default.conf" + cat ~/.config/lxc/default.conf + toolsclean: - rm -f $(TOOLS_D) + rm -rf $(TOOLS_D) + rm -rf $(ROOT)/test/test_helper + rm -rf $(ROOT)/bats-core clean: toolsclean - rm -f $(ROOT)/bin - rm .made-* + rm -rf $(ROOT)/bin + rm -f .made-*