Skip to content

Commit aea231b

Browse files
committed
Rename to deb-installation-test.sh
1 parent 5a1c1f5 commit aea231b

5 files changed

Lines changed: 61 additions & 53 deletions

File tree

.github/workflows/pkg-deb.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,14 @@ jobs:
110110
- name: Test package installation
111111
run: |
112112
version="${{ steps.get_version.outputs.version }}"
113+
113114
# Install the package
114115
sudo dpkg -i dist/chsrc_${version}-1_amd64.deb || true
115116
sudo apt-get install -f -y || true
116117
117-
# Run basic tests
118-
if [ -f "pkg/DEB/deb-test.sh" ]; then
119-
sudo bash pkg/DEB/deb-test.sh
120-
else
121-
# Basic manual test
122-
chsrc help
123-
echo "Package installation test passed!"
124-
fi
118+
# Run DEB installation tests
119+
bash pkg/DEB/deb-installation-test.sh
120+
125121
126122
- name: Upload DEB artifact
127123
uses: actions/upload-artifact@v4

pkg/DEB/BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ sudo apt-get install -f # 修复依赖问题
7878

7979
```bash
8080
# 运行测试
81-
./deb-test.sh
81+
bash ./deb-installation-test.sh
8282

8383
# 查看文档安装情况
8484
man chsrc

pkg/DEB/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- `debian/` - DEB 包构建配置目录
2828
- `BUILD.md` - 如何手动构建
2929
- `deb.makefile` - DEB 包构建 Makefile
30-
- `deb-test.sh` - DEB 包 **已正确安装** 测试脚本
30+
- `deb-installation-test.sh` - DEB 包 **已正确安装** 测试脚本
3131

3232
<br>
3333

pkg/DEB/deb-installation-test.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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!"

pkg/DEB/deb-test.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)