mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-19 10:35:34 +08:00
Rename to deb-installation-test.sh
This commit is contained in:
parent
5a1c1f5470
commit
aea231bbc0
12
.github/workflows/pkg-deb.yml
vendored
12
.github/workflows/pkg-deb.yml
vendored
@ -110,18 +110,14 @@ jobs:
|
|||||||
- name: Test package installation
|
- name: Test package installation
|
||||||
run: |
|
run: |
|
||||||
version="${{ steps.get_version.outputs.version }}"
|
version="${{ steps.get_version.outputs.version }}"
|
||||||
|
|
||||||
# Install the package
|
# Install the package
|
||||||
sudo dpkg -i dist/chsrc_${version}-1_amd64.deb || true
|
sudo dpkg -i dist/chsrc_${version}-1_amd64.deb || true
|
||||||
sudo apt-get install -f -y || true
|
sudo apt-get install -f -y || true
|
||||||
|
|
||||||
# Run basic tests
|
# Run DEB installation tests
|
||||||
if [ -f "pkg/DEB/deb-test.sh" ]; then
|
bash pkg/DEB/deb-installation-test.sh
|
||||||
sudo bash pkg/DEB/deb-test.sh
|
|
||||||
else
|
|
||||||
# Basic manual test
|
|
||||||
chsrc help
|
|
||||||
echo "Package installation test passed!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Upload DEB artifact
|
- name: Upload DEB artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
@ -78,7 +78,7 @@ sudo apt-get install -f # 修复依赖问题
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 运行测试
|
# 运行测试
|
||||||
./deb-test.sh
|
bash ./deb-installation-test.sh
|
||||||
|
|
||||||
# 查看文档安装情况
|
# 查看文档安装情况
|
||||||
man chsrc
|
man chsrc
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
- `debian/` - DEB 包构建配置目录
|
- `debian/` - DEB 包构建配置目录
|
||||||
- `BUILD.md` - 如何手动构建
|
- `BUILD.md` - 如何手动构建
|
||||||
- `deb.makefile` - DEB 包构建 Makefile
|
- `deb.makefile` - DEB 包构建 Makefile
|
||||||
- `deb-test.sh` - DEB 包 **已正确安装** 测试脚本
|
- `deb-installation-test.sh` - DEB 包 **已正确安装** 测试脚本
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
55
pkg/DEB/deb-installation-test.sh
Normal file
55
pkg/DEB/deb-installation-test.sh
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# --------------------------------------------------------------
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
# --------------------------------------------------------------
|
||||||
|
# Test File : deb-installation-test.sh
|
||||||
|
# File Authors : sanchuanhehe <wyihe5520@gmail.com>
|
||||||
|
# Contributors : Aoran Zeng <ccmywish@qq.com>
|
||||||
|
# |
|
||||||
|
# Created On : <2025-06-14>
|
||||||
|
# Last Modified : <2025-06-15>
|
||||||
|
#
|
||||||
|
# Test script for DEB package installation
|
||||||
|
# --------------------------------------------------------------
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing installation of DEB package 'chsrc' ..."
|
||||||
|
|
||||||
|
# Test 1: Check if chsrc binary exists and is executable
|
||||||
|
if [ ! -f "/usr/bin/chsrc" ]; then
|
||||||
|
echo "ERROR: /usr/bin/chsrc not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "/usr/bin/chsrc" ]; then
|
||||||
|
echo "ERROR: /usr/bin/chsrc is not executable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✓ /usr/bin/chsrc binary exists and is executable"
|
||||||
|
|
||||||
|
# Test 2: Check if man page exists
|
||||||
|
if [ ! -f "/usr/share/man/man1/chsrc.1" ]; then
|
||||||
|
echo "WARNING: chsrc man page not found at /usr/share/man/man1/chsrc.1"
|
||||||
|
else
|
||||||
|
echo "✓ chsrc man page exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test 3: Test basic functionality
|
||||||
|
echo "Testing basic chsrc functionality..."
|
||||||
|
if /usr/bin/chsrc help >/dev/null 2>&1; then
|
||||||
|
echo "✓ command 'chsrc help' works"
|
||||||
|
else
|
||||||
|
echo "ERROR: command 'chsrc help' failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if /usr/bin/chsrc list >/dev/null 2>&1; then
|
||||||
|
echo "✓ command 'chsrc list' works"
|
||||||
|
else
|
||||||
|
echo "ERROR: command 'chsrc list' failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "All installation tests of DEB package 'chsrc' passed!"
|
@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Test script for DEB package functionality
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "Testing chsrc DEB package..."
|
|
||||||
|
|
||||||
# Test 1: Check if chsrc binary exists and is executable
|
|
||||||
if [ ! -f "/usr/bin/chsrc" ]; then
|
|
||||||
echo "ERROR: chsrc binary not found at /usr/bin/chsrc"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -x "/usr/bin/chsrc" ]; then
|
|
||||||
echo "ERROR: chsrc binary is not executable"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "✓ chsrc binary exists and is executable"
|
|
||||||
|
|
||||||
# Test 2: Check if man page exists
|
|
||||||
if [ ! -f "/usr/share/man/man1/chsrc.1" ]; then
|
|
||||||
echo "WARNING: chsrc man page not found at /usr/share/man/man1/chsrc.1"
|
|
||||||
else
|
|
||||||
echo "✓ chsrc man page exists"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Test 3: Test basic functionality
|
|
||||||
echo "Testing basic chsrc functionality..."
|
|
||||||
if chsrc help >/dev/null 2>&1; then
|
|
||||||
echo "✓ chsrc help command works"
|
|
||||||
else
|
|
||||||
echo "ERROR: chsrc help command failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if chsrc list >/dev/null 2>&1; then
|
|
||||||
echo "✓ chsrc list command works"
|
|
||||||
else
|
|
||||||
echo "WARNING: chsrc list command failed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "All DEB package tests passed!"
|
|
Loading…
x
Reference in New Issue
Block a user