Skip to content

Commit

Permalink
TMP: try to debug idmap issue in gh runners
Browse files Browse the repository at this point in the history
Signed-off-by: Michael McCracken <[email protected]>
  • Loading branch information
mikemccracken committed Oct 21, 2024
1 parent da9cf7f commit 7ee00d5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 24 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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-*

0 comments on commit 7ee00d5

Please sign in to comment.