aboutsummaryrefslogtreecommitdiffstats
path: root/.extras/image-builder/test-image-builder.sh
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-14 17:03:08 +0200
committerDanilo M. <danix@danix.xyz>2026-07-14 17:03:08 +0200
commitabccc01065b74f06191c7b408ee2903aca9fdcfb (patch)
treef21136474e50ebc8e52300536e11a7c7813460ff /.extras/image-builder/test-image-builder.sh
parent8e3003d162ec1e362523c0d3c232753950d2d343 (diff)
downloadsbo-slackbuilds-abccc01065b74f06191c7b408ee2903aca9fdcfb.tar.gz
sbo-slackbuilds-abccc01065b74f06191c7b408ee2903aca9fdcfb.zip
extract docker tooling to ../sbo-dockerbuild
The test-build tool and image-builder chain grew from a .extras/ helper into a standalone toolchain, now maintained in its own repo (../sbo-dockerbuild). Remove them here (scripts, examples, design docs) and repoint CLAUDE.md: test-building is now done with the installed `test-build` CLI, deps resolved from the SBo tree, both trees verified per bump. Package-maintenance files stay: nvchecker.toml, hooks/, assets/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to '.extras/image-builder/test-image-builder.sh')
-rwxr-xr-x.extras/image-builder/test-image-builder.sh68
1 files changed, 0 insertions, 68 deletions
diff --git a/.extras/image-builder/test-image-builder.sh b/.extras/image-builder/test-image-builder.sh
deleted file mode 100755
index 39d3f1c..0000000
--- a/.extras/image-builder/test-image-builder.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-# Assert-based self-check for lib.sh pure logic. No docker, no network.
-# Run: bash .extras/image-builder/test-image-builder.sh
-set -u
-cd "$(dirname "$0")"
-source ./lib.sh
-
-pass=0 fail=0
-check() { # DESC EXPECTED ACTUAL
- if [[ "$2" == "$3" ]]; then pass=$((pass+1));
- else fail=$((fail+1)); echo "FAIL: $1"; echo " expected: [$2]"; echo " actual: [$3]"; fi
-}
-check_rc() { # DESC EXPECTED_RC ACTUAL_RC
- if [[ "$2" == "$3" ]]; then pass=$((pass+1));
- else fail=$((fail+1)); echo "FAIL: $1 (rc expected $2 got $3)"; fi
-}
-
-tmp="$(mktemp -d)"
-trap 'rm -rf "$tmp"' EXIT
-
-# --- mirror_path ---
-check "mirror_path trailing slash" \
- "file:///mnt/nas/slackware64-current/PACKAGES.TXT" \
- "$(mirror_path 'file:///mnt/nas/' 'slackware64-current/PACKAGES.TXT')"
-check "mirror_path no trailing slash" \
- "file:///mnt/nas/x/y" "$(mirror_path 'file:///mnt/nas' '/x/y')"
-
-# --- is_local_mirror ---
-is_local_mirror "file:///mnt/nas"; check_rc "is_local file://" 0 $?
-is_local_mirror "/mnt/nas"; check_rc "is_local bare abs" 0 $?
-is_local_mirror "https://x/y"; check_rc "is_local https" 1 $?
-
-# --- strip_scheme ---
-check "strip_scheme file://" "/mnt/nas" "$(strip_scheme 'file:///mnt/nas')"
-check "strip_scheme bare" "/mnt/nas" "$(strip_scheme '/mnt/nas')"
-
-# --- fetch: local file resolves ---
-echo hello > "$tmp/src.txt"
-fetch "file://$tmp/src.txt" "$tmp/dst.txt"; check_rc "fetch local ok" 0 $?
-check "fetch local content" "hello" "$(cat "$tmp/dst.txt" 2>/dev/null)"
-
-# --- fetch: missing local file errors ---
-fetch "file://$tmp/nope.txt" "$tmp/x.txt"; check_rc "fetch local missing" 1 $?
-
-# --- txz_hash: stable + content-sensitive ---
-mkdir -p "$tmp/pkgs"
-printf a > "$tmp/pkgs/sbopkg-1.txz"
-printf b > "$tmp/pkgs/tools-1.txz"
-h1="$(txz_hash "$tmp/pkgs")"
-h2="$(txz_hash "$tmp/pkgs")"
-check "txz_hash stable" "$h1" "$h2"
-printf c > "$tmp/pkgs/tools-1.txz" # change content
-h3="$(txz_hash "$tmp/pkgs")"
-check_rc "txz_hash changes on content" 0 "$([[ "$h1" != "$h3" ]] && echo 0 || echo 1)"
-check "txz_hash empty dir" "" "$(txz_hash "$tmp/empty-nope")"
-
-# --- require_mount: missing mount errors (subshell to catch _err exit) ---
-MIRROR="file://$tmp/no-such-root"
-( require_mount current ) 2>/dev/null; check_rc "require_mount missing" 1 $?
-mkdir -p "$tmp/mnt/slackware64-current"
-MIRROR="file://$tmp/mnt"
-( require_mount current ) 2>/dev/null; check_rc "require_mount present" 0 $?
-MIRROR="https://example/x"
-( require_mount current ) 2>/dev/null; check_rc "require_mount http skips" 0 $?
-
-echo "----"
-echo "PASS: $pass FAIL: $fail"
-[[ "$fail" -eq 0 ]]