|
| 1 | +#!/bin/bash |
| 2 | +# -------------------------------------------------------------- |
| 3 | +# SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | +# -------------------------------------------------------------- |
| 5 | +# Test File : deb-installation-test.sh |
| 6 | +# File Authors : sanchuanhehe <wyihe5520@gmail.com> |
| 7 | +# Contributors : Aoran Zeng <ccmywish@qq.com> |
| 8 | +# | |
| 9 | +# Created On : <2025-06-14> |
| 10 | +# Last Modified : <2025-06-15> |
| 11 | +# |
| 12 | +# Test script for DEB package installation |
| 13 | +# -------------------------------------------------------------- |
| 14 | + |
| 15 | +set -e |
| 16 | + |
| 17 | +echo "Testing installation of DEB package 'chsrc' ..." |
| 18 | + |
| 19 | +# Test 1: Check if chsrc binary exists and is executable |
| 20 | +if [ ! -f "/usr/bin/chsrc" ]; then |
| 21 | + echo "ERROR: /usr/bin/chsrc not found" |
| 22 | + exit 1 |
| 23 | +fi |
| 24 | + |
| 25 | +if [ ! -x "/usr/bin/chsrc" ]; then |
| 26 | + echo "ERROR: /usr/bin/chsrc is not executable" |
| 27 | + exit 1 |
| 28 | +fi |
| 29 | + |
| 30 | +echo "✓ /usr/bin/chsrc binary exists and is executable" |
| 31 | + |
| 32 | +# Test 2: Check if man page exists |
| 33 | +if [ ! -f "/usr/share/man/man1/chsrc.1" ]; then |
| 34 | + echo "WARNING: chsrc man page not found at /usr/share/man/man1/chsrc.1" |
| 35 | +else |
| 36 | + echo "✓ chsrc man page exists" |
| 37 | +fi |
| 38 | + |
| 39 | +# Test 3: Test basic functionality |
| 40 | +echo "Testing basic chsrc functionality..." |
| 41 | +if /usr/bin/chsrc help >/dev/null 2>&1; then |
| 42 | + echo "✓ command 'chsrc help' works" |
| 43 | +else |
| 44 | + echo "ERROR: command 'chsrc help' failed" |
| 45 | + exit 1 |
| 46 | +fi |
| 47 | + |
| 48 | +if /usr/bin/chsrc list >/dev/null 2>&1; then |
| 49 | + echo "✓ command 'chsrc list' works" |
| 50 | +else |
| 51 | + echo "ERROR: command 'chsrc list' failed" |
| 52 | + exit 1 |
| 53 | +fi |
| 54 | + |
| 55 | +echo "All installation tests of DEB package 'chsrc' passed!" |
0 commit comments