Skip to content

Commit 78aba20

Browse files
committed
devenv: Add tmt and nushell
- Add tmt testing framework to CentOS Stream 10 (via EPEL) and Debian (via pip3) - Add nushell modern shell to both environments via binary installation - Include comprehensive test coverage and error handling - Configure renovate for nushell version management - Fix nushell version format (use 0.110.0 not v0.101.0) Addresses requirements from #55. Assisted-by: OpenCode (Sonnet 4.5)
1 parent 18de411 commit 78aba20

8 files changed

Lines changed: 115 additions & 6 deletions

File tree

devenv/Containerfile.c10s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ FROM base as tools
3030
ARG bcvkversion=v0.9.0
3131
# renovate: datasource=github-releases depName=ossf/scorecard
3232
ARG scorecardversion=v5.1.1
33+
# renovate: datasource=github-releases depName=nushell/nushell
34+
ARG nushellversion=0.110.0
3335
COPY fetch-tools.sh /run/src/
34-
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion /run/src/fetch-tools.sh
36+
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion nushellversion=$nushellversion /run/src/fetch-tools.sh
3537

3638
FROM base as rust
3739
COPY install-rust.sh /run/src/

devenv/Containerfile.debian

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ FROM base as tools
3030
ARG bcvkversion=v0.9.0
3131
# renovate: datasource=github-releases depName=ossf/scorecard
3232
ARG scorecardversion=v5.1.1
33+
# renovate: datasource=github-releases depName=nushell/nushell
34+
ARG nushellversion=0.110.0
3335
COPY fetch-tools.sh /run/src/
34-
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion /run/src/fetch-tools.sh
36+
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion nushellversion=$nushellversion /run/src/fetch-tools.sh
3537

3638
FROM base as rust
3739
COPY install-rust.sh /run/src/
@@ -59,6 +61,11 @@ EORUN
5961
COPY npm.txt /run/src
6062
RUN grep -vEe '^#' npm.txt | /bin/time -f '%E %C' xargs npm i -g
6163

64+
# Install tmt and provision[virtual] for testing
65+
# TODO: maybe try to run tmt via uv ?
66+
RUN pip3 install --break-system-packages tmt[provision-virtual] && \
67+
rm -rf ~/.cache/pip
68+
6269
# Copy in the binaries from our tools container image
6370
COPY --from=tools /usr/local/bin/* /usr/local/bin/
6471
COPY --from=kani /usr/local/bin/* /usr/local/bin/

devenv/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ This container image is suitable for use on
44
developing projects in the bootc-dev organization,
55
especially bootc.
66

7-
It includes all tools used in the Justfile
8-
for relevant projects.
7+
The goal is to make this completely usable as a devcontainer
8+
with tools such as VSCode remote containers, Codespaces,
9+
[devpod](https://devpod.sh/) and others.
10+
11+
Specifically this includes e.g.:
12+
13+
- Rust and C/C++ toolchains
14+
- `nu`
15+
- [tmt](https://tmt.readthedocs.io/)
16+
- [Kani](https://model-checking.github.io/kani/usage.html) for system verification
917

1018
## Base image
1119

devenv/devenv-init.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
2-
# Thin wrapper that calls the Python implementation
3-
exec python3 /usr/lib/devenv/userns-setup "$@"
2+
# Initialize development environment
3+
set -euo pipefail
4+
5+
# Set up podman for nested containers
6+
python3 /usr/lib/devenv/userns-setup "$@"

devenv/devenv-selftest.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,68 @@ else
3939
echo "=== Skipping bcvk VM test (bcvk not available or /dev/kvm missing) ==="
4040
fi
4141

42+
# Test new tools added to devenv
43+
echo ""
44+
echo "=== Testing additional devenv tools ==="
45+
46+
# Test nushell - should be available on all images
47+
echo "Testing nushell..."
48+
if ! command -v nu >/dev/null 2>&1; then
49+
echo "Error: nushell (nu) command not found" >&2
50+
exit 1
51+
fi
52+
echo "nushell version:"
53+
nu --version
54+
echo "nushell basic functionality test:"
55+
echo 'print "Hello from nushell!"' | nu
56+
echo "=== nushell test passed ==="
57+
58+
# Test tmt - available on both systems but installed differently
59+
echo "Testing tmt..."
60+
if ! command -v tmt >/dev/null 2>&1; then
61+
echo "Error: tmt command not found" >&2
62+
exit 1
63+
fi
64+
echo "tmt version:"
65+
tmt --version
66+
echo "tmt basic functionality test:"
67+
# Create a minimal test directory with a working tmt setup
68+
tmpdir=$(mktemp -d)
69+
(
70+
cd "$tmpdir"
71+
# Create basic fmf metadata directory and file
72+
mkdir -p .fmf
73+
echo "1" > .fmf/version
74+
75+
# Create a minimal test
76+
mkdir -p tests
77+
cat > tests/basic.fmf <<EOF
78+
summary: Basic validation test
79+
test: echo "tmt test validation passed"
80+
duration: 5s
81+
EOF
82+
83+
# Create a minimal plan
84+
mkdir -p plans
85+
cat > plans/basic.fmf <<EOF
86+
summary: Basic validation plan
87+
discover:
88+
how: fmf
89+
execute:
90+
how: local
91+
EOF
92+
93+
# Test tmt functionality
94+
echo "Testing tmt plan discovery..."
95+
tmt plan ls
96+
echo "Testing tmt test discovery..."
97+
tmt test ls
98+
echo "Basic tmt validation complete"
99+
)
100+
rm -rf "$tmpdir"
101+
echo "=== tmt test passed ==="
102+
103+
104+
42105
echo ""
43106
echo "=== All tests passed ==="

devenv/fetch-tools.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -xeuo pipefail
66
# Required environment variables (passed as build ARGs)
77
: "${bcvkversion:?bcvkversion is required}"
88
: "${scorecardversion:?scorecardversion is required}"
9+
: "${nushellversion:?nushellversion is required}"
910

1011
arch=$(arch)
1112

@@ -42,3 +43,22 @@ td=$(mktemp -d)
4243
mv scorecard /usr/local/bin/scorecard
4344
)
4445
rm -rf $td
46+
47+
# nushell - modern shell
48+
td=$(mktemp -d)
49+
(
50+
cd $td
51+
# Map arch to nushell naming convention
52+
case "${arch}" in
53+
x86_64) nuarch=x86_64 ;;
54+
aarch64) nuarch=aarch64 ;;
55+
*) echo "nushell unavailable for $arch"; return 0 ;;
56+
esac
57+
target=nu-${nushellversion}-${nuarch}-unknown-linux-gnu.tar.gz
58+
/bin/time -f '%E %C' curl -fLO https://github.com/nushell/nushell/releases/download/$nushellversion/$target
59+
tar xvzf $target
60+
# The extracted directory has the same name as the archive without .tar.gz
61+
extracted_dir=nu-${nushellversion}-${nuarch}-unknown-linux-gnu
62+
mv $extracted_dir/nu /usr/local/bin/nu
63+
)
64+
rm -rf $td

devenv/packages-c10s.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ xorriso
1212
qemu-img
1313
libvirt-daemon-kvm
1414

15+
# Testing framework
16+
tmt
17+
1518
# TUI editors
1619
vim-enhanced

devenv/packages-debian.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ genisoimage
1212
qemu-utils
1313
libvirt-daemon-system
1414

15+
# Python package management
16+
python3-pip
17+
1518
# TUI editors
1619
vim

0 commit comments

Comments
 (0)