forked from woqidaideshi/openruyi-autotest
Compare commits
47
Commits
dev
..
sakura286-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03a23224a1 | ||
|
|
9d8a140b68 | ||
|
|
1d7340e96e | ||
|
|
9f0b3f5935 | ||
|
|
1fb30e5398 | ||
|
|
fac8213444 | ||
|
|
74b4eb4ef2 | ||
|
|
1c44966f8b | ||
|
|
166498ad14 | ||
|
|
653327ee0c | ||
|
|
0c4a2bce72 | ||
|
|
593a557da5 | ||
|
|
27061e6998 | ||
|
|
28f3537fee | ||
|
|
22d4200131 | ||
|
|
e96a5cc0de | ||
|
|
68fe8a888f | ||
|
|
c5179e7810 | ||
|
|
c43bf658c2 | ||
|
|
bca1403d90 | ||
|
|
1fe92117f7 | ||
|
|
fdb39411f0 | ||
|
|
3b45cf8824 | ||
|
|
154a5589d8 | ||
|
|
060fd0e9b0 | ||
|
|
f1f021c723 | ||
|
|
236668bb45 | ||
|
|
f07d0e8273 | ||
|
|
8230c053e4 | ||
|
|
1ea0908577 | ||
|
|
78d407b3a1 | ||
|
|
7447fba291 | ||
|
|
55cfb7a3de | ||
|
|
f7ab0a24d4 | ||
|
|
3fdc015d3a | ||
|
|
a9d06c91b7 | ||
|
|
a8e32815cd | ||
|
|
574334d2a7 | ||
|
|
b168a2aeb7 | ||
|
|
b6e89f140c | ||
|
|
05655f11e5 | ||
|
|
6a9813f22c | ||
|
|
cdcb31b850 | ||
|
|
ebc7b27da9 | ||
|
|
bca2ec0fd5 | ||
|
|
037da90e37 | ||
|
|
e694932048 |
@@ -459,162 +459,3 @@ cat "$BASE/tests/functional/pkgs/acl/test_acl_getfacl_basic-1/output.txt"
|
||||
| 11 | `test_acl_tool_installation` | ACL 工具安装检查 |
|
||||
|
||||
> 共 11 个用例,全部通过即为 ACL 功能正常。此套件可作为其他软件包测试的参考模板。其他 `tests/functional/pkgs/<包名>/` 下的测试套执行方式与此完全相同,只需将 `test --name` 中的 `acl` 替换为目标包名即可。
|
||||
|
||||
---
|
||||
|
||||
## 10. 实战示例:K8s 特性测试(RISC-V)
|
||||
|
||||
本节以 `feature/k8s` 测试套为例,展示如何在 RISC-V 架构的 K8s 集群上执行特性测试。
|
||||
|
||||
### 10.1 前提条件
|
||||
|
||||
- **2 台 RISC-V 服务器**(1 个 K8s master + 1 个 worker 节点)
|
||||
- 服务器已安装 K8s 集群(v1.35+),Calico CNI,containerd 运行时
|
||||
- 每台服务器最低配置:**8 核 CPU,8 GiB 内存,1 个网卡**
|
||||
- 每台服务器已安装 `beakerlib`、`sshpass`(参考第 1 节)
|
||||
|
||||
> **K8s 环境说明**:RISC-V 服务器上 `/etc/kubernetes/admin.conf` 通常属于 root 用户(权限 600),测试脚本会自动通过 `sudo` 调用 `kubectl`。
|
||||
|
||||
### 10.2 克隆仓库并安装依赖
|
||||
|
||||
在 master 节点上执行:
|
||||
|
||||
```bash
|
||||
git clone https://git.openruyi.cn/woqidaideshi/openruyi-autotest.git
|
||||
cd openruyi-autotest
|
||||
|
||||
# 安装 beakerlib 和 sshpass
|
||||
sudo dnf install -y beakerlib sshpass
|
||||
|
||||
# riscv64 架构如需安装 tmt(可选,直接 bash 执行不需要 tmt)
|
||||
sudo pip3 install --break-system-packages tmt
|
||||
```
|
||||
|
||||
### 10.3 配置 topology.env
|
||||
|
||||
K8s 测试需要 2 台服务器,**必须配置 `topology.env`**:
|
||||
|
||||
```bash
|
||||
cp topology.env.example topology.env
|
||||
vim topology.env
|
||||
```
|
||||
|
||||
写入内容(示例为 10.20.238.253 上的 2 节点 K8s 集群):
|
||||
|
||||
```ini
|
||||
TEST_SERVER_COUNT=2
|
||||
|
||||
# Server 1: K8s master 节点
|
||||
TEST_SERVER_1_HOST=10.20.238.253
|
||||
TEST_SERVER_1_PORT=12055
|
||||
TEST_SERVER_1_USER=openruyi
|
||||
TEST_SERVER_1_PASSWORD=openruyi
|
||||
|
||||
# Server 2: K8s worker 节点
|
||||
TEST_SERVER_2_HOST=10.20.238.253
|
||||
TEST_SERVER_2_PORT=12056
|
||||
TEST_SERVER_2_USER=openruyi
|
||||
TEST_SERVER_2_PASSWORD=openruyi
|
||||
```
|
||||
|
||||
### 10.4 执行 K8s 快速健康检查
|
||||
|
||||
K8s 测试套提供了 **6 个子分类**,建议先执行 `quick` 快速验证集群是否正常:
|
||||
|
||||
```bash
|
||||
cd ~/openruyi-autotest
|
||||
|
||||
# 方式一:使用 tmt 执行(单个用例)
|
||||
tmt run --all --verbose plan --name /plans/feature \
|
||||
test --name /tests/feature/k8s/test_k8s_quick_health_check \
|
||||
provision --feeling-safe
|
||||
|
||||
# 方式二:直接 bash 执行(推荐,更快速)
|
||||
TMT_TEST_TOPOLOGY_FILE="$PWD/topology.env" \
|
||||
bash tests/feature/k8s/test_k8s_quick_health_check.sh
|
||||
```
|
||||
|
||||
**预期输出:**
|
||||
|
||||
```
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Verify kubectl is available
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: [ ... ] :: [ PASS ] :: kubectl client is installed
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Verify K8s cluster nodes status
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: [ ... ] :: [ PASS ] :: List cluster nodes
|
||||
:: [ ... ] :: [ PASS ] :: All nodes are in Ready state
|
||||
:: [ ... ] :: [ PASS ] :: Cluster has 2 nodes (>= 2)
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Verify kube-system pods are running
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: [ ... ] :: [ PASS ] :: At least N kube-system pods are Running
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Verify CoreDNS is running
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: [ ... ] :: [ PASS ] :: CoreDNS has N Running pod(s)
|
||||
```
|
||||
|
||||
### 10.5 执行全部 K8s 测试
|
||||
|
||||
```bash
|
||||
cd ~/openruyi-autotest
|
||||
|
||||
# 使用 tmt 一次性执行所有 k8s 测试
|
||||
tmt run --all --verbose plan --name /plans/feature \
|
||||
test --name /tests/feature/k8s \
|
||||
provision --feeling-safe
|
||||
```
|
||||
|
||||
> **注意**:完整执行大约需要 **30 分钟**,具体时间取决于集群性能。
|
||||
|
||||
### 10.6 K8s 测试分类说明
|
||||
|
||||
| 分类 | 测试脚本 | 说明 | 预计耗时 |
|
||||
|------|----------|------|----------|
|
||||
| `quick` | `test_k8s_quick_health_check.sh` | 快速冒烟测试,验证集群基本健康 | ~5 分钟 |
|
||||
| `conformance` | `test_k8s_conformance_pod_lifecycle.sh` | Pod 生命周期管理(创建、删除、扩缩容) | ~8 分钟 |
|
||||
| `network` | `test_k8s_network_cross_node_communication.sh` | 跨节点网络通信(ClusterIP、NodePort、DNS) | ~5 分钟 |
|
||||
| `storage` | `test_k8s_storage_pvc_lifecycle.sh` | PVC 存储卷生命周期(挂载、写入、持久化) | ~5 分钟 |
|
||||
| `scheduling` | `test_k8s_scheduling_pod_affinity.sh` | Pod 调度策略(亲和性、nodeSelector、配额) | ~5 分钟 |
|
||||
| `workload` | `test_k8s_workload_config_primitives.sh` | 工作负载配置(ConfigMap、Secret、ServiceAccount) | ~5 分钟 |
|
||||
| `kata` | `test_k8s_kata_containers_runtime.sh` | Kata 安全容器运行时验证 | ~10 分钟 |
|
||||
|
||||
每个测试脚本都可单独执行:
|
||||
|
||||
```bash
|
||||
# 例如只执行网络测试
|
||||
TMT_TEST_TOPOLOGY_FILE="$PWD/topology.env" \
|
||||
bash tests/feature/k8s/test_k8s_network_cross_node_communication.sh
|
||||
|
||||
# 只执行存储测试
|
||||
TMT_TEST_TOPOLOGY_FILE="$PWD/topology.env" \
|
||||
bash tests/feature/k8s/test_k8s_storage_pvc_lifecycle.sh
|
||||
```
|
||||
|
||||
### 10.7 查看测试结果
|
||||
|
||||
使用 `tmt run` 执行时,结果存放在 `/var/tmp/tmt/run-*` 目录下(参考第 5 节)。
|
||||
|
||||
直接 bash 执行时,beakerlib 会在终端实时输出结果,最终显示汇总:
|
||||
|
||||
```
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: OVERALL RESULT: PASS (unknown)
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
```
|
||||
|
||||
各阶段的详细日志临时存放在 `/var/tmp/beakerlib-*` 目录下。
|
||||
|
||||
### 10.8 环境变量说明
|
||||
|
||||
| 变量 | 说明 | 默认值 |
|
||||
|------|------|--------|
|
||||
| `TMT_TEST_TOPOLOGY_FILE` | 拓扑配置文件路径 | 未设置时本地执行 |
|
||||
| `K8S_KUBECONFIG` | kubectl 配置文件路径 | `/etc/kubernetes/admin.conf` |
|
||||
| `K8S_USE_SUDO` | 是否使用 sudo 执行 kubectl | `true` |
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
summary: K8s feature tests - cluster ready precheck
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- cluster
|
||||
duration: 5m
|
||||
tier: 1
|
||||
path: /tests/feature/k8s/cluster_ready
|
||||
require:
|
||||
- beakerlib
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
# K8s feature test: cluster ready precheck
|
||||
# Verify the RISC-V K8s cluster is ready before running sonobuoy smoke:
|
||||
# - kubectl CLI available
|
||||
# - kubeconfig readable (admin.conf)
|
||||
# - kubectl can reach the cluster API
|
||||
# - all nodes are Ready (expect 2: master + worker)
|
||||
#
|
||||
# Runs LOCALLY on the K8s master node (tmt provision: local).
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
K8S_KUBECONFIG="/etc/kubernetes/admin.conf"
|
||||
EXPECT_NODES=2
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
rlRun "id" 0 "Current user"
|
||||
rlRun "uname -m" 0 "Architecture (expect riscv64)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "K8s cluster ready precheck"
|
||||
# 1. kubectl CLI available
|
||||
rlRun "command -v kubectl" 0 "kubectl CLI is available"
|
||||
|
||||
# 2. kubeconfig exists and readable
|
||||
if [ ! -r "$K8S_KUBECONFIG" ]; then
|
||||
rlFail "kubeconfig not readable: $K8S_KUBECONFIG"
|
||||
else
|
||||
rlPass "kubeconfig readable: $K8S_KUBECONFIG"
|
||||
fi
|
||||
|
||||
# 3. kubectl can reach the cluster API
|
||||
rlRun "kubectl --kubeconfig=$K8S_KUBECONFIG version --client" 0 "kubectl client version"
|
||||
rlRun "kubectl --kubeconfig=$K8S_KUBECONFIG cluster-info" 0 "Cluster API reachable"
|
||||
|
||||
# 4. All nodes Ready (expect 2)
|
||||
local node_count ready_count
|
||||
node_count=$(kubectl --kubeconfig=$K8S_KUBECONFIG get nodes --no-headers 2>/dev/null | wc -l)
|
||||
ready_count=$(kubectl --kubeconfig=$K8S_KUBECONFIG get nodes --no-headers 2>/dev/null | awk '{print $2}' | grep -c '^Ready$')
|
||||
rlLogInfo "Node count: $node_count, Ready count: $ready_count (expect $EXPECT_NODES)"
|
||||
if [ "$node_count" -eq "$EXPECT_NODES" ] && [ "$ready_count" -eq "$EXPECT_NODES" ]; then
|
||||
rlPass "All $EXPECT_NODES nodes are Ready"
|
||||
else
|
||||
rlFail "Expected $EXPECT_NODES Ready nodes, got $node_count total / $ready_count Ready"
|
||||
kubectl --kubeconfig=$K8S_KUBECONFIG get nodes -o wide
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Regular → Executable
+113
-134
@@ -1,158 +1,137 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# library-prefix = k8s
|
||||
|
||||
#
|
||||
|
||||
# K8s suite-level shared library
|
||||
# ============================================================
|
||||
# Uses flag-file + reference counting to ensure the k8s cluster
|
||||
# connectivity check runs only ONCE across all test cases.
|
||||
#
|
||||
# Usage in each test file:
|
||||
# . "$(dirname "$0")/../lib.sh" # from subdirectories
|
||||
# . "$(dirname "$0")/lib.sh" # from k8s/ directory
|
||||
#
|
||||
# Then call: k8sSetup in rlPhaseStartSetup
|
||||
# Cleanup is auto-registered via rlCleanupAppend.
|
||||
|
||||
K8S_FLAG="/tmp/.beakerlib_k8s_feature_suite"
|
||||
# Provides sonobuoy CLI installation/removal with reference counting,
|
||||
|
||||
k8sSetup() {
|
||||
# and smoke plugin manifest download.
|
||||
|
||||
#
|
||||
|
||||
# All functions run LOCALLY on the K8s master node (tmt provision: local).
|
||||
|
||||
# No SSH remote invocation is involved.
|
||||
|
||||
#
|
||||
|
||||
# Sonobuoy facts (verified):
|
||||
# - CLI: sonobuoy-v0.57.3-riscv64, SHA256 0f5642a5ecbecc79e79aa3a1ab015c2e77d0027c51938fee7d5ac9d8dfd166be
|
||||
# - Source: https://nexus.osssc.ac.cn/repository/openruyi-k8s/v1.35.5/sonobuoy/bin/sonobuoy-v0.57.3-riscv64
|
||||
# - Smoke plugin manifest:
|
||||
# https://nexus.osssc.ac.cn/repository/openruyi-k8s/v1.35.5/manifests/openruyi-riscv-sonobuoy-smoke.yaml
|
||||
#
|
||||
# Usage:
|
||||
# . "$(dirname "$0")/../lib.sh" # from cluster_ready/ or sonobuoy_smoke/
|
||||
# k8sLibSetup # in Setup phase
|
||||
# k8sFetchSmokePlugin # fetch plugin manifest to /tmp
|
||||
# k8sLibCleanup # registered via rlCleanupAppend
|
||||
|
||||
K8S_FLAG="/tmp/.beakerlib_k8s_suite"
|
||||
|
||||
SONOBUOY_VERSION="v0.57.3"
|
||||
SONOBUOY_BIN="sonobuoy-${SONOBUOY_VERSION}-riscv64"
|
||||
SONOBUOY_INSTALL="/usr/local/bin/sonobuoy"
|
||||
SONOBUOY_SHA256="0f5642a5ecbecc79e79aa3a1ab015c2e77d0027c51938fee7d5ac9d8dfd166be"
|
||||
SONOBUOY_URL="https://nexus.osssc.ac.cn/repository/openruyi-k8s/v1.35.5/sonobuoy/bin/${SONOBUOY_BIN}"
|
||||
|
||||
K8S_SMOKE_PLUGIN="/tmp/openruyi-riscv-sonobuoy-smoke.yaml"
|
||||
K8S_SMOKE_PLUGIN_URL="https://nexus.osssc.ac.cn/repository/openruyi-k8s/v1.35.5/manifests/openruyi-riscv-sonobuoy-smoke.yaml"
|
||||
|
||||
K8S_KUBECONFIG="/etc/kubernetes/admin.conf"
|
||||
|
||||
|
||||
|
||||
# Download sonobuoy CLI, verify SHA256, install to /usr/local/bin.
|
||||
# Returns 0 on success, 1 on failure (after retries).
|
||||
_k8sInstallSonobuoy() {
|
||||
local attempts=0
|
||||
while [ "$attempts" -lt 2 ]; do
|
||||
attempts=$((attempts + 1))
|
||||
rlLogInfo "Downloading sonobuoy (attempt $attempts/2): $SONOBUOY_URL"
|
||||
if rlRun "curl -fsSL -o /tmp/$SONOBUOY_BIN '$SONOBUOY_URL'" 0 "Download sonobuoy"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ ! -f "/tmp/$SONOBUOY_BIN" ]; then
|
||||
rlFail "Sonobuoy download failed after retries"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Verify SHA256
|
||||
local actual
|
||||
actual=$(sha256sum "/tmp/$SONOBUOY_BIN" | awk '{print $1}')
|
||||
if [ "$actual" != "$SONOBUOY_SHA256" ]; then
|
||||
rlLogWarning "SHA256 mismatch (got $actual), re-downloading once"
|
||||
rm -f "/tmp/$SONOBUOY_BIN"
|
||||
rlRun "curl -fsSL -o /tmp/$SONOBUOY_BIN '$SONOBUOY_URL'" 0 "Re-download sonobuoy"
|
||||
actual=$(sha256sum "/tmp/$SONOBUOY_BIN" | awk '{print $1}')
|
||||
if [ "$actual" != "$SONOBUOY_SHA256" ]; then
|
||||
rlFail "Sonobuoy SHA256 verification failed"
|
||||
rm -f "/tmp/$SONOBUOY_BIN"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
rlRun "install -m 0755 /tmp/$SONOBUOY_BIN '$SONOBUOY_INSTALL'" 0 "Install sonobuoy to /usr/local/bin"
|
||||
rm -f "/tmp/$SONOBUOY_BIN"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Download the official smoke plugin manifest to /tmp.
|
||||
# Returns 0 on success, 1 on failure.
|
||||
k8sFetchSmokePlugin() {
|
||||
rlRun "curl -fsSL -o '$K8S_SMOKE_PLUGIN' '$K8S_SMOKE_PLUGIN_URL'" 0 "Download smoke plugin manifest"
|
||||
if [ ! -s "$K8S_SMOKE_PLUGIN" ]; then
|
||||
rlFail "Smoke plugin manifest is empty or missing"
|
||||
return 1
|
||||
fi
|
||||
rlLogInfo "Smoke plugin manifest ready: $K8S_SMOKE_PLUGIN"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Suite-level setup with reference counting.
|
||||
# Install sonobuoy only once across all cases; register cleanup.
|
||||
k8sLibSetup() {
|
||||
if [ ! -f "$K8S_FLAG" ]; then
|
||||
# First test to arrive: verify cluster connectivity
|
||||
rlLogInfo "K8s suite: first test, verifying cluster connectivity..."
|
||||
|
||||
# Source topology
|
||||
if [ -f "$TMT_TEST_TOPOLOGY_FILE" ]; then
|
||||
. "$TMT_TEST_TOPOLOGY_FILE"
|
||||
# First case in suite: install sonobuoy
|
||||
if ! _k8sInstallSonobuoy; then
|
||||
rlFail "Sonobuoy installation failed (setup FAIL, case SKIP)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Write topology fallback
|
||||
if [ -z "${TEST_SERVER_1_HOST:-}" ]; then
|
||||
echo "installed=1" > "$K8S_FLAG"
|
||||
echo "ref=1" >> "$K8S_FLAG"
|
||||
rlLogInfo "K8s: no topology file, running on local cluster"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Verify SSH to master node
|
||||
local ssh_cmd="sshpass -p '${TEST_SERVER_1_PASSWORD:-}' ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -p ${TEST_SERVER_1_PORT:-22} ${TEST_SERVER_1_USER:-root}@${TEST_SERVER_1_HOST}"
|
||||
|
||||
if $ssh_cmd "which kubectl" 2>/dev/null; then
|
||||
echo "installed=0" > "$K8S_FLAG"
|
||||
rlLogInfo "K8s master node reachable, kubectl found"
|
||||
else
|
||||
echo "installed=1" > "$K8S_FLAG"
|
||||
rlLogInfo "K8s master node reachable but kubectl not found"
|
||||
fi
|
||||
echo "ref=1" >> "$K8S_FLAG"
|
||||
rlRun "sonobuoy version" 0 "Verify sonobuoy CLI"
|
||||
echo "ref=1" > "$K8S_FLAG"
|
||||
else
|
||||
# Subsequent tests: increment ref count
|
||||
local ref
|
||||
ref=$(grep "^ref=" "$K8S_FLAG" | cut -d= -f2)
|
||||
ref=$((ref + 1))
|
||||
sed -i "s/^ref=.*/ref=$ref/" "$K8S_FLAG"
|
||||
rlLogInfo "K8s suite already initialized by other test, reference count: $ref"
|
||||
fi
|
||||
|
||||
rlCleanupAppend "k8sCleanup"
|
||||
rlCleanupAppend "k8sLibCleanup"
|
||||
return 0
|
||||
}
|
||||
|
||||
k8sCleanup() {
|
||||
if [ ! -f "$K8S_FLAG" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
# Suite-level cleanup with reference counting.
|
||||
# Remove sonobuoy only when the last case finishes.
|
||||
k8sLibCleanup() {
|
||||
if [ ! -f "$K8S_FLAG" ]; then return 0; fi
|
||||
local ref
|
||||
ref=$(grep "^ref=" "$K8S_FLAG" | cut -d= -f2)
|
||||
ref=$((ref - 1))
|
||||
|
||||
if [ "$ref" -le 0 ]; then
|
||||
rlLogInfo "K8s suite: last test, cleaning up..."
|
||||
rm -f "$K8S_FLAG"
|
||||
rlRun "rm -f '$SONOBUOY_INSTALL'" 0 "Remove sonobuoy binary"
|
||||
rlLogInfo "K8s suite cleanup complete"
|
||||
else
|
||||
sed -i "s/^ref=.*/ref=$ref/" "$K8S_FLAG"
|
||||
rlLogInfo "K8s suite: retain (still have $ref test(s) not completed)"
|
||||
rlLogInfo "K8s suite retained (still have $ref test(s) not completed)"
|
||||
fi
|
||||
}
|
||||
|
||||
# ============================================================
|
||||
# K8s config (discovered at setup time)
|
||||
# ============================================================
|
||||
K8S_KUBECONFIG="${K8S_KUBECONFIG:-/etc/kubernetes/admin.conf}"
|
||||
K8S_USE_SUDO="${K8S_USE_SUDO:-true}"
|
||||
|
||||
# ============================================================
|
||||
# Helper: source topology variables
|
||||
# ============================================================
|
||||
_k8sSourceTopology() {
|
||||
if [ -f "$TMT_TEST_TOPOLOGY_FILE" ]; then
|
||||
. "$TMT_TEST_TOPOLOGY_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
# ============================================================
|
||||
# Helper: execute command on K8s master node via SSH
|
||||
# ============================================================
|
||||
_k8sMasterSSH() {
|
||||
local cmd="$1"
|
||||
_k8sSourceTopology
|
||||
local host="${TEST_SERVER_1_HOST:-127.0.0.1}"
|
||||
local port="${TEST_SERVER_1_PORT:-22}"
|
||||
local user="${TEST_SERVER_1_USER:-root}"
|
||||
local pass="${TEST_SERVER_1_PASSWORD:-}"
|
||||
|
||||
if command -v sshpass &>/dev/null; then
|
||||
sshpass -p "$pass" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -p "$port" "$user@$host" "$cmd" 2>/dev/null
|
||||
else
|
||||
# Fallback: use expect-style password injection via ssh -o PasswordAuthentication
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o PreferredAuthentications=password \
|
||||
-o PubkeyAuthentication=no -p "$port" "$user@$host" "echo '$pass' | sudo -S true 2>/dev/null; $cmd" 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
# ============================================================
|
||||
# Helper: execute kubectl command on K8s master node
|
||||
# Uses sudo because kubeconfig is owned by root on RISC-V K8s nodes
|
||||
# ============================================================
|
||||
k8sKubectl() {
|
||||
local args="$*"
|
||||
if [ -f "$TMT_TEST_TOPOLOGY_FILE" ]; then
|
||||
_k8sSourceTopology
|
||||
local pass="${TEST_SERVER_1_PASSWORD:-}"
|
||||
if [ "$K8S_USE_SUDO" = "true" ]; then
|
||||
_k8sMasterSSH "echo '$pass' | sudo -S kubectl --kubeconfig=$K8S_KUBECONFIG $args"
|
||||
else
|
||||
_k8sMasterSSH "kubectl --kubeconfig=$K8S_KUBECONFIG $args"
|
||||
fi
|
||||
else
|
||||
# Local execution: use sudo because kubeconfig is root-owned on RISC-V
|
||||
if [ "$K8S_USE_SUDO" = "true" ]; then
|
||||
sudo kubectl --kubeconfig="$K8S_KUBECONFIG" $args
|
||||
else
|
||||
kubectl --kubeconfig="$K8S_KUBECONFIG" $args
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# ============================================================
|
||||
# Helper: check K8s cluster health
|
||||
# ============================================================
|
||||
k8sClusterHealthCheck() {
|
||||
rlLogInfo "Checking K8s cluster health..."
|
||||
|
||||
# Check nodes
|
||||
local nodes_output
|
||||
nodes_output=$(k8sKubectl get nodes --no-headers 2>&1)
|
||||
rlAssertNotGrep "NotReady\|SchedulingDisabled" "$nodes_output" "All nodes are Ready"
|
||||
|
||||
# Count ready nodes
|
||||
local ready_count
|
||||
ready_count=$(echo "$nodes_output" | grep -c "Ready" || true)
|
||||
rlLogInfo "Ready nodes: $ready_count"
|
||||
rlAssertGreaterOrEqual "At least 2 nodes ready" "$ready_count" 2
|
||||
|
||||
# Check pods in kube-system
|
||||
local pods_output
|
||||
pods_output=$(k8sKubectl get pods -n kube-system --no-headers 2>&1)
|
||||
local running_count
|
||||
running_count=$(echo "$pods_output" | grep -c "Running" || true)
|
||||
rlLogInfo "Running pods in kube-system: $running_count"
|
||||
}
|
||||
|
||||
@@ -1,83 +1,8 @@
|
||||
summary: Feature test - K8s cluster functionality verification on RISC-V
|
||||
summary: K8s feature tests
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- riscv
|
||||
duration: 30m
|
||||
tier: 1
|
||||
extra-hardware-require:
|
||||
server: ">= 2"
|
||||
cpu: ">= 8"
|
||||
memory: ">= 8 GiB"
|
||||
net: ">= 1"
|
||||
disk: ">= 1"
|
||||
|
||||
/test_k8s_quick_health_check:
|
||||
summary: K8s quick smoke test - verify cluster health
|
||||
test: ./test_k8s_quick_health_check.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- quick
|
||||
duration: 5m
|
||||
tier: 1
|
||||
|
||||
/test_k8s_conformance_pod_lifecycle:
|
||||
summary: K8s conformance - pod lifecycle verification
|
||||
test: ./test_k8s_conformance_pod_lifecycle.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- conformance
|
||||
duration: 15m
|
||||
tier: 1
|
||||
|
||||
/test_k8s_network_cross_node_communication:
|
||||
summary: K8s network - cross-node pod communication verification
|
||||
test: ./test_k8s_network_cross_node_communication.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- network
|
||||
duration: 10m
|
||||
tier: 1
|
||||
|
||||
/test_k8s_storage_pvc_lifecycle:
|
||||
summary: K8s storage - local-path-provisioner PVC verification
|
||||
test: ./test_k8s_storage_pvc_lifecycle.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- storage
|
||||
duration: 10m
|
||||
tier: 1
|
||||
|
||||
/test_k8s_scheduling_pod_affinity:
|
||||
summary: K8s scheduling - pod anti-affinity and nodeSelector
|
||||
test: ./test_k8s_scheduling_pod_affinity.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- scheduling
|
||||
duration: 10m
|
||||
tier: 1
|
||||
|
||||
/test_k8s_workload_config_primitives:
|
||||
summary: K8s workload - ConfigMap, Secret, and ServiceAccount
|
||||
test: ./test_k8s_workload_config_primitives.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- workload
|
||||
duration: 10m
|
||||
tier: 1
|
||||
|
||||
/test_k8s_kata_containers_runtime:
|
||||
summary: K8s Kata Containers - verify kata-clh RuntimeClass
|
||||
test: ./test_k8s_kata_containers_runtime.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- kata
|
||||
duration: 15m
|
||||
tier: 1
|
||||
path: /tests/feature/k8s
|
||||
require:
|
||||
- beakerlib
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
summary: K8s feature tests - sonobuoy smoke
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- feature
|
||||
- k8s
|
||||
- sonobuoy
|
||||
duration: 20m
|
||||
tier: 1
|
||||
path: /tests/feature/k8s/sonobuoy_smoke
|
||||
require:
|
||||
- beakerlib
|
||||
Executable
+74
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
# K8s feature test: sonobuoy smoke
|
||||
# Run the official openruyi-riscv sonobuoy smoke plugin against the cluster:
|
||||
# sonobuoy delete -> run -> retrieve -> results (full closed loop)
|
||||
# Expect: Total: 2, Passed: 2, Failed: 0, every node status: passed
|
||||
#
|
||||
# Runs LOCALLY on the K8s master node (tmt provision: local).
|
||||
# Sonobuoy CLI calls are written out explicitly (no hidden wrappers).
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/../lib.sh"
|
||||
|
||||
SONOBUOY_CMD="/usr/local/bin/sonobuoy"
|
||||
KUBECONFIG="/etc/kubernetes/admin.conf"
|
||||
SMOKE_PLUGIN="/tmp/openruyi-riscv-sonobuoy-smoke.yaml"
|
||||
RESULTS_DIR="/tmp"
|
||||
RESULTS_TAR="$RESULTS_DIR/k8s-smoke-results.tar.gz"
|
||||
RESULTS_LOG="$RESULTS_DIR/k8s-smoke-results.txt"
|
||||
SONOBUOY_IMAGE="localhost/sonobuoy/sonobuoy:v0.57.3-riscv64"
|
||||
|
||||
EXPECT_TOTAL=2
|
||||
EXPECT_PASSED=2
|
||||
EXPECT_FAILED=0
|
||||
|
||||
# Add sudo prefix when not running as root (kubeconfig + /usr/local/bin are root-owned)
|
||||
SUDO_PREFIX=""
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
SUDO_PREFIX="sudo -n"
|
||||
fi
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sLibSetup
|
||||
k8sFetchSmokePlugin
|
||||
rlRun "kubectl --kubeconfig=$KUBECONFIG get nodes" 0 "List cluster nodes"
|
||||
rlRun "cd $RESULTS_DIR" 0 "Enter results directory"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Sonobuoy smoke test (full loop)"
|
||||
# 1. Clean any leftovers from previous runs
|
||||
rlRun "$SUDO_PREFIX $SONOBUOY_CMD delete --wait --kubeconfig=$KUBECONFIG || true" 0 "Clean previous sonobuoy resources"
|
||||
|
||||
# 2. Run the smoke plugin (DaemonSet, one pod per node), wait for completion
|
||||
rlRun "$SUDO_PREFIX $SONOBUOY_CMD run \
|
||||
--sonobuoy-image $SONOBUOY_IMAGE \
|
||||
--plugin $SMOKE_PLUGIN \
|
||||
--image-pull-policy Never \
|
||||
--wait \
|
||||
--kubeconfig=$KUBECONFIG" 0 "Run sonobuoy smoke plugin (--wait)"
|
||||
|
||||
# 3. Retrieve results archive (note: -f name is saved under CWD, so cd to /tmp first)
|
||||
rlRun "$SUDO_PREFIX $SONOBUOY_CMD retrieve -f $(basename $RESULTS_TAR) --kubeconfig=$KUBECONFIG" 0 "Retrieve results archive"
|
||||
rlAssertExists "$RESULTS_TAR"
|
||||
|
||||
# 4. Parse results (report mode)
|
||||
rlRun "set -o pipefail; $SUDO_PREFIX $SONOBUOY_CMD results $RESULTS_TAR --mode=report 2>&1 | tee $RESULTS_LOG" 0 "Parse sonobuoy results (report mode)"
|
||||
|
||||
# 5. Assert summary counts
|
||||
rlAssertGrep "Passed: $EXPECT_PASSED" "$RESULTS_LOG"
|
||||
rlAssertGrep "Failed: $EXPECT_FAILED" "$RESULTS_LOG"
|
||||
rlAssertGrep "Total: $EXPECT_TOTAL" "$RESULTS_LOG"
|
||||
|
||||
# 6. Assert every node passed
|
||||
rlAssertGrep "Status: passed" "$RESULTS_LOG"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
# Remove cluster resources (distinct from binary removal in k8sLibCleanup)
|
||||
rlRun "$SUDO_PREFIX $SONOBUOY_CMD delete --wait --kubeconfig=$KUBECONFIG || true" 0 "Delete sonobuoy cluster resources"
|
||||
rlRun "rm -f $RESULTS_TAR $RESULTS_LOG" 0 "Remove results archive and log"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,157 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Feature test: K8s Conformance - Pod lifecycle verification
|
||||
# ============================================================
|
||||
# Purpose: Verify basic K8s pod lifecycle (create/delete/multi-replica)
|
||||
# which is the foundation for all K8s workloads.
|
||||
# This is a lightweight alternative to full Sonobuoy conformance.
|
||||
# ============================================================
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
|
||||
TEST_NS="k8s-feature-test-conformance"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sSetup
|
||||
# Ensure clean namespace
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl create namespace "$TEST_NS" 2>/dev/null
|
||||
rlLogInfo "Created test namespace: $TEST_NS"
|
||||
# Wait for namespace to be ready
|
||||
sleep 2
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create a single pod with busybox"
|
||||
cat > /tmp/test-pod.yaml << 'PODEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: test-pod
|
||||
namespace: PODNS
|
||||
spec:
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sleep", "3600"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
restartPolicy: Never
|
||||
PODEOF
|
||||
sed -i "s/PODNS/$TEST_NS/g" /tmp/test-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/test-pod.yaml 2>/dev/null
|
||||
# Wait for pod to be ready
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod test-pod -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
output=$(k8sKubectl get pod test-pod -n "$TEST_NS" --no-headers 2>&1)
|
||||
rlAssertGrep "Running" "$output" "Pod test-pod is Running"
|
||||
rlLogInfo "Pod status: $output"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create a Deployment with 2 replicas"
|
||||
cat > /tmp/test-deploy.yaml << 'DEPLOYEOF'
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-nginx
|
||||
namespace: DEPNS
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: test-nginx
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: test-nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.27-alpine
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
DEPLOYEOF
|
||||
sed -i "s/DEPNS/$TEST_NS/g" /tmp/test-deploy.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/test-deploy.yaml 2>/dev/null
|
||||
# Wait for deployment to be ready
|
||||
for i in $(seq 1 60); do
|
||||
ready=$(k8sKubectl get deployment test-nginx -n "$TEST_NS" -o jsonpath='{.status.readyReplicas}' 2>/dev/null)
|
||||
if [ "$ready" = "2" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
output=$(k8sKubectl get deployment test-nginx -n "$TEST_NS" --no-headers 2>&1)
|
||||
rlAssertGrep "2/2" "$output" "Deployment test-nginx has 2/2 replicas ready"
|
||||
rlLogInfo "Deployment status: $output"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify pod distribution across nodes"
|
||||
pods=$(k8sKubectl get pods -n "$TEST_NS" -l app=test-nginx -o wide --no-headers 2>&1)
|
||||
rlRun "echo '$pods'" 0 "List nginx pods with node distribution"
|
||||
node1=$(echo "$pods" | awk 'NR==1{print $7}')
|
||||
node2=$(echo "$pods" | awk 'NR==2{print $7}')
|
||||
if [ "$node1" != "$node2" ]; then
|
||||
rlPass "Pods are distributed across different nodes: $node1 and $node2"
|
||||
else
|
||||
rlLogInfo "Pods scheduled on same node: $node1 (may be OK for 2-replica test)"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Delete pod and verify auto-recreation"
|
||||
pod_name=$(k8sKubectl get pods -n "$TEST_NS" -l app=test-nginx -o jsonpath='{.items[0].metadata.name}' 2>/dev/null)
|
||||
rlLogInfo "Deleting pod: $pod_name"
|
||||
k8sKubectl delete pod "$pod_name" -n "$TEST_NS" --wait 2>/dev/null
|
||||
sleep 3
|
||||
new_output=$(k8sKubectl get pods -n "$TEST_NS" -l app=test-nginx --no-headers 2>&1)
|
||||
pod_count=$(echo "$new_output" | wc -l)
|
||||
if [ "$pod_count" -eq 2 ]; then
|
||||
rlPass "Deployment auto-recreated pod (found $pod_count pods)"
|
||||
else
|
||||
rlFail "Expected 2 pods but found $pod_count"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Scale up Deployment to verify node capacity"
|
||||
k8sKubectl scale deployment test-nginx -n "$TEST_NS" --replicas=4 2>/dev/null
|
||||
sleep 10
|
||||
scaled_output=$(k8sKubectl get deployment test-nginx -n "$TEST_NS" --no-headers 2>&1)
|
||||
ready_count=$(echo "$scaled_output" | awk '{print $2}')
|
||||
rlLogInfo "Scaled deployment: $scaled_output"
|
||||
if [ "$ready_count" = "4/4" ]; then
|
||||
rlPass "Deployment scaled to 4 replicas successfully"
|
||||
else
|
||||
rlLogInfo "Deployment at $ready_count (may be limited by node resources in QEMU)"
|
||||
fi
|
||||
# Scale back
|
||||
k8sKubectl scale deployment test-nginx -n "$TEST_NS" --replicas=1 2>/dev/null
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
rm -f /tmp/test-pod.yaml /tmp/test-deploy.yaml
|
||||
rlLogInfo "Test namespace $TEST_NS cleaned up"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,164 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Feature test: K8s Kata Containers - RuntimeClass verification
|
||||
# ============================================================
|
||||
# Purpose: Verify Kata Containers (kata-clh) RuntimeClass works
|
||||
# on RISC-V K8s cluster. This validates the secure
|
||||
# container runtime deployed alongside containerd.
|
||||
# ============================================================
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
|
||||
TEST_NS="k8s-feature-test-kata"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sSetup
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl create namespace "$TEST_NS" 2>/dev/null
|
||||
sleep 2
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify kata-clh RuntimeClass exists"
|
||||
rc_output=$(k8sKubectl get runtimeclass 2>&1)
|
||||
rlLogInfo "RuntimeClasses: $(echo \"$rc_output\")"
|
||||
if echo "$rc_output" | grep -q "kata-clh"; then
|
||||
rlPass "kata-clh RuntimeClass exists"
|
||||
else
|
||||
rlFail "kata-clh RuntimeClass not found"
|
||||
rlLogInfo "Skipping remaining kata tests"
|
||||
# Still report the test phases but as skipped
|
||||
rlPhaseEnd
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
rlLogInfo "Cleanup done (partial due to skip)"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
exit 0
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create Kata pod with kata-clh runtime"
|
||||
cat > /tmp/kata-pod.yaml << 'KATAEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: kata-test-pod
|
||||
namespace: KATANS
|
||||
spec:
|
||||
runtimeClassName: kata-clh
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sleep", "120"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: Never
|
||||
KATAEOF
|
||||
sed -i "s/KATANS/$TEST_NS/g" /tmp/kata-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/kata-pod.yaml 2>/dev/null
|
||||
# Wait longer for Kata (VM boot)
|
||||
for i in $(seq 1 45); do
|
||||
status=$(k8sKubectl get pod kata-test-pod -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
if [ "$status" = "Failed" ]; then
|
||||
rlFail "Kata pod failed during startup"
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
kata_output=$(k8sKubectl get pod kata-test-pod -n "$TEST_NS" --no-headers 2>&1)
|
||||
rlLogInfo "Kata pod status: $kata_output"
|
||||
rlAssertGrep "Running" "$kata_output" "Kata pod is Running via kata-clh runtime"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify Kata pod isolation by checking kernel"
|
||||
# Get uname from inside the Kata pod
|
||||
uname_output=$(k8sKubectl exec kata-test-pod -n "$TEST_NS" -- uname -r 2>&1)
|
||||
rlLogInfo "Kata pod kernel: $uname_output"
|
||||
|
||||
# Get host kernel for comparison
|
||||
if [ -f "$TMT_TEST_TOPOLOGY_FILE" ]; then
|
||||
. "$TMT_TEST_TOPOLOGY_FILE"
|
||||
host_kernel=$(sshpass -p "${TEST_SERVER_1_PASSWORD:-}" ssh -o StrictHostKeyChecking=no \
|
||||
-p "${TEST_SERVER_1_PORT:-22}" "${TEST_SERVER_1_USER:-root}@${TEST_SERVER_1_HOST}" "uname -r" 2>/dev/null)
|
||||
rlLogInfo "Host kernel: $host_kernel"
|
||||
if [ "$uname_output" != "$host_kernel" ]; then
|
||||
rlPass "Kata pod uses its own kernel (different from host)"
|
||||
else
|
||||
rlLogInfo "Kata and host kernel version match (may be expected for cloud-hypervisor)"
|
||||
fi
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify network connectivity for Kata pod"
|
||||
# Check if kata pod can resolve DNS
|
||||
dns_test=$(k8sKubectl exec kata-test-pod -n "$TEST_NS" -- nslookup kubernetes.default.svc.cluster.local 2>&1)
|
||||
rlLogInfo "Kata pod DNS: $(echo \"$dns_test\" | head -2)"
|
||||
|
||||
# Test network connectivity
|
||||
net_test=$(k8sKubectl exec kata-test-pod -n "$TEST_NS" -- wget -q -O - -T 5 http://10.96.0.1:443/version 2>&1)
|
||||
rlLogInfo "Kata pod network test to API server: $(echo \"$net_test\" | head -2)"
|
||||
|
||||
if echo "$dns_test" | grep -q "10.96"; then
|
||||
rlPass "Kata pod has DNS resolution"
|
||||
else
|
||||
rlLogInfo "Kata pod DNS test returned unexpected result (may be OK)"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Compare runc vs kata-clh pod startup performance"
|
||||
# Create a regular runc pod for comparison
|
||||
cat > /tmp/runc-pod.yaml << 'RUNCEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: runc-test-pod
|
||||
namespace: KATANS
|
||||
spec:
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sleep", "10"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
restartPolicy: Never
|
||||
RUNCEOF
|
||||
sed -i "s/KATANS/$TEST_NS/g" /tmp/runc-pod.yaml
|
||||
|
||||
start_time=$(date +%s)
|
||||
k8sKubectl apply -f /tmp/runc-pod.yaml 2>/dev/null
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod runc-test-pod -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
end_time=$(date +%s)
|
||||
runc_startup=$((end_time - start_time))
|
||||
rlLogInfo "runc pod startup time: ${runc_startup}s"
|
||||
rlLogInfo "Kata pod startup is expected to be slower due to VM boot overhead"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
rm -f /tmp/kata-pod.yaml /tmp/runc-pod.yaml
|
||||
rlLogInfo "Test namespace $TEST_NS cleaned up"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,152 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Feature test: K8s Network - Cross-node pod communication
|
||||
# ============================================================
|
||||
# Purpose: Verify Calico CNI enables cross-node pod-to-pod
|
||||
# and pod-to-service communication on RISC-V.
|
||||
# ============================================================
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
|
||||
TEST_NS="k8s-feature-test-network"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sSetup
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl create namespace "$TEST_NS" 2>/dev/null
|
||||
sleep 2
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Deploy nginx server and expose via ClusterIP"
|
||||
cat > /tmp/nginx-svc.yaml << 'EOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: nginx-server
|
||||
namespace: NETNS
|
||||
labels:
|
||||
app: nginx-server
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.27-alpine
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "100m"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-svc
|
||||
namespace: NETNS
|
||||
spec:
|
||||
selector:
|
||||
app: nginx-server
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
type: ClusterIP
|
||||
EOF
|
||||
sed -i "s/NETNS/$TEST_NS/g" /tmp/nginx-svc.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/nginx-svc.yaml 2>/dev/null
|
||||
# Wait for nginx pod
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod nginx-server -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
rlLogInfo "Nginx server pod deployed"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create client pod and verify ClusterIP access"
|
||||
cat > /tmp/client-pod.yaml << 'CLIENTEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: net-client
|
||||
namespace: CLNS
|
||||
spec:
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sleep", "3600"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
CLIENTEOF
|
||||
sed -i "s/CLNS/$TEST_NS/g" /tmp/client-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/client-pod.yaml 2>/dev/null
|
||||
# Wait for client pod
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod net-client -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Get ClusterIP
|
||||
svc_ip=$(k8sKubectl get svc nginx-svc -n "$TEST_NS" -o jsonpath='{.spec.clusterIP}' 2>/dev/null)
|
||||
rlLogInfo "ClusterIP of nginx-svc: $svc_ip"
|
||||
rlAssertNotEmpty "$svc_ip" "ClusterIP is assigned"
|
||||
|
||||
# Test connectivity from client pod
|
||||
curl_output=$(k8sKubectl exec net-client -n "$TEST_NS" -- wget -q -O - -T 5 "http://$svc_ip" 2>&1)
|
||||
if echo "$curl_output" | grep -q "nginx\|Welcome\|html"; then
|
||||
rlPass "Pod-to-ClusterIP connectivity works (got nginx response)"
|
||||
else
|
||||
rlLogInfo "wget output: $(echo "$curl_output" | head -3)"
|
||||
rlFail "Failed to reach nginx via ClusterIP"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify DNS resolution from client pod"
|
||||
dns_output=$(k8sKubectl exec net-client -n "$TEST_NS" -- nslookup nginx-svc 2>&1)
|
||||
rlLogInfo "DNS lookup result: $dns_output"
|
||||
if echo "$dns_output" | grep -q "$svc_ip"; then
|
||||
rlPass "DNS resolves nginx-svc to ClusterIP $svc_ip"
|
||||
else
|
||||
rlLogInfo "DNS may not have resolved correctly, checking by IP directly"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create NodePort service and test external access"
|
||||
k8sKubectl expose pod nginx-server -n "$TEST_NS" --name=nginx-nodeport --type=NodePort --port=80 2>/dev/null
|
||||
nodeport=$(k8sKubectl get svc nginx-nodeport -n "$TEST_NS" -o jsonpath='{.spec.ports[0].nodePort}' 2>/dev/null)
|
||||
rlLogInfo "NodePort: $nodeport"
|
||||
|
||||
# Test NodePort from master node via SSH
|
||||
if [ -f "$TMT_TEST_TOPOLOGY_FILE" ]; then
|
||||
. "$TMT_TEST_TOPOLOGY_FILE"
|
||||
master_host="${TEST_SERVER_1_HOST:-127.0.0.1}"
|
||||
master_port="${TEST_SERVER_1_PORT:-22}"
|
||||
master_user="${TEST_SERVER_1_USER:-root}"
|
||||
master_pass="${TEST_SERVER_1_PASSWORD:-}"
|
||||
nodeport_output=$(sshpass -p "$master_pass" ssh -o StrictHostKeyChecking=no -p "$master_port" "$master_user@$master_host" \
|
||||
"curl -s --connect-timeout 5 http://127.0.0.1:$nodeport" 2>&1)
|
||||
if echo "$nodeport_output" | grep -qi "nginx\|Welcome\|html"; then
|
||||
rlPass "NodePort service accessible on master node port $nodeport"
|
||||
else
|
||||
rlFail "NodePort service not accessible (output: $(echo \"$nodeport_output\" | head -1))"
|
||||
fi
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
rm -f /tmp/nginx-svc.yaml /tmp/client-pod.yaml
|
||||
rlLogInfo "Test namespace $TEST_NS cleaned up"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,88 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Feature test: K8s - Quick cluster health verification
|
||||
# ============================================================
|
||||
# Purpose: Fast smoke test to verify K8s cluster basic health.
|
||||
# This is the FIRST test to run to ensure cluster is working.
|
||||
# Expected environment: 2 nodes (1 master + 1 worker), RISC-V QEMU VMs
|
||||
# ============================================================
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sSetup
|
||||
rlLogInfo "Starting K8s quick health check..."
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify kubectl is available"
|
||||
output=$(k8sKubectl version --client -o json 2>&1)
|
||||
rlAssertGrep "clientVersion" "$output" "kubectl client is installed"
|
||||
rlLogInfo "kubectl version info: $(echo \"$output\" | head -5)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify K8s cluster nodes status"
|
||||
output=$(k8sKubectl get nodes --no-headers 2>&1)
|
||||
rlRun "echo '$output'" 0 "List cluster nodes"
|
||||
|
||||
# Check all nodes are Ready
|
||||
not_ready=$(echo "$output" | grep -v "Ready" | wc -l)
|
||||
if [ "$not_ready" -eq 0 ]; then
|
||||
rlPass "All nodes are in Ready state"
|
||||
else
|
||||
rlFail "Found $not_ready node(s) not in Ready state"
|
||||
fi
|
||||
|
||||
# Check we have at least 2 nodes
|
||||
node_count=$(echo "$output" | wc -l)
|
||||
if [ "$node_count" -ge 2 ]; then
|
||||
rlPass "Cluster has $node_count nodes (>= 2)"
|
||||
else
|
||||
rlFail "Cluster has only $node_count node(s), expected >= 2"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify kube-system pods are running"
|
||||
output=$(k8sKubectl get pods -n kube-system --no-headers 2>&1)
|
||||
rlRun "echo '$output'" 0 "List kube-system pods"
|
||||
|
||||
running=$(echo "$output" | grep -c "Running" || true)
|
||||
total=$(echo "$output" | wc -l)
|
||||
rlLogInfo "Running pods: $running / $total in kube-system"
|
||||
|
||||
if [ "$running" -ge 5 ]; then
|
||||
rlPass "At least $running kube-system pods are Running"
|
||||
else
|
||||
rlFail "Only $running kube-system pods Running, expected >= 5"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify Calico CNI status"
|
||||
# Check Calico pods
|
||||
calico_pods=$(k8sKubectl get pods -n kube-system -l k8s-app=calico-node --no-headers 2>&1)
|
||||
calico_ready=$(echo "$calico_pods" | grep -c "Running" || true)
|
||||
rlLogInfo "Calico node pods running: $calico_ready"
|
||||
|
||||
# Check Calico Ds
|
||||
calico_ds=$(k8sKubectl get ds -n kube-system calico-node --no-headers 2>&1)
|
||||
rlAssertNotGrep "0" "$(echo \"$calico_ds\" | awk '{print \$2}')" "Calico DaemonSet has ready pods"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify CoreDNS is running"
|
||||
dns_pods=$(k8sKubectl get pods -n kube-system -l k8s-app=kube-dns --no-headers 2>&1)
|
||||
dns_ready=$(echo "$dns_pods" | grep -c "Running" || true)
|
||||
if [ "$dns_ready" -ge 1 ]; then
|
||||
rlPass "CoreDNS has $dns_ready Running pod(s)"
|
||||
else
|
||||
rlFail "CoreDNS pods not Running (expected >= 1)"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlLogInfo "Quick health check completed"
|
||||
# No resources to clean up
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,162 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Feature test: K8s Scheduling - Anti-affinity and nodeSelector
|
||||
# ============================================================
|
||||
# Purpose: Verify K8s scheduler correctly distributes pods
|
||||
# using anti-affinity rules on RISC-V nodes.
|
||||
# ============================================================
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
|
||||
TEST_NS="k8s-feature-test-scheduling"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sSetup
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl create namespace "$TEST_NS" 2>/dev/null
|
||||
sleep 2
|
||||
|
||||
# Get node count
|
||||
NODE_COUNT=$(k8sKubectl get nodes --no-headers 2>/dev/null | grep -c "Ready" || echo 0)
|
||||
rlLogInfo "Available nodes: $NODE_COUNT"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create anti-affinity deployment"
|
||||
cat > /tmp/anti-affinity-deploy.yaml << 'EOF'
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: anti-affinity-test
|
||||
namespace: SCHNS
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: anti-affinity-test
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: anti-affinity-test
|
||||
spec:
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: app
|
||||
operator: In
|
||||
values:
|
||||
- anti-affinity-test
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sleep", "600"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
EOF
|
||||
sed -i "s/SCHNS/$TEST_NS/g" /tmp/anti-affinity-deploy.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/anti-affinity-deploy.yaml 2>/dev/null
|
||||
|
||||
for i in $(seq 1 30); do
|
||||
ready=$(k8sKubectl get deployment anti-affinity-test -n "$TEST_NS" -o jsonpath='{.status.readyReplicas}' 2>/dev/null)
|
||||
if [ "$ready" = "2" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
pods_output=$(k8sKubectl get pods -n "$TEST_NS" -l app=anti-affinity-test -o wide --no-headers 2>&1)
|
||||
rlRun "echo '$pods_output'" 0 "List anti-affinity pods"
|
||||
|
||||
if [ "$NODE_COUNT" -ge 2 ]; then
|
||||
node1=$(echo "$pods_output" | awk 'NR==1{print $7}')
|
||||
node2=$(echo "$pods_output" | awk 'NR==2{print $7}')
|
||||
if [ "$node1" != "$node2" ]; then
|
||||
rlPass "Anti-affinity working: pods on different nodes ($node1 vs $node2)"
|
||||
else
|
||||
rlFail "Anti-affinity failed: both pods on same node $node1"
|
||||
fi
|
||||
else
|
||||
rlLogInfo "Only $NODE_COUNT node(s), skipping anti-affinity check"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create nodeSelector deployment"
|
||||
# Get any node name
|
||||
target_node=$(k8sKubectl get nodes -o jsonpath='{.items[0].metadata.name}' 2>/dev/null)
|
||||
rlLogInfo "Target node for nodeSelector: $target_node"
|
||||
|
||||
cat > /tmp/nodeselector-test.yaml << 'NSEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: nodeselector-pod
|
||||
namespace: SCHNS
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: "NODE_NAME"
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sleep", "300"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
NSEOF
|
||||
sed -i "s/SCHNS/$TEST_NS/g" /tmp/nodeselector-test.yaml
|
||||
sed -i "s/NODE_NAME/$target_node/g" /tmp/nodeselector-test.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/nodeselector-test.yaml 2>/dev/null
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod nodeselector-pod -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
scheduled_node=$(k8sKubectl get pod nodeselector-pod -n "$TEST_NS" -o jsonpath='{.spec.nodeName}' 2>/dev/null)
|
||||
if [ "$scheduled_node" = "$target_node" ]; then
|
||||
rlPass "nodeSelector works: pod scheduled to $target_node"
|
||||
else
|
||||
rlFail "nodeSelector failed: expected $target_node but got $scheduled_node"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify resource quota limits"
|
||||
cat > /tmp/rq-test.yaml << 'RQEOF'
|
||||
apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: compute-quota
|
||||
namespace: SCHNS
|
||||
spec:
|
||||
hard:
|
||||
pods: "10"
|
||||
requests.cpu: "4"
|
||||
requests.memory: "4Gi"
|
||||
limits.cpu: "8"
|
||||
limits.memory: "8Gi"
|
||||
RQEOF
|
||||
sed -i "s/SCHNS/$TEST_NS/g" /tmp/rq-test.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/rq-test.yaml 2>/dev/null
|
||||
rq_output=$(k8sKubectl get resourcequota compute-quota -n "$TEST_NS" --no-headers 2>&1)
|
||||
rlAssertNotGrep "not found\|Error" "$rq_output" "ResourceQuota is created"
|
||||
rlLogInfo "ResourceQuota: $(echo \"$rq_output\" | head -1)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
rm -f /tmp/anti-affinity-deploy.yaml /tmp/nodeselector-test.yaml /tmp/rq-test.yaml
|
||||
rlLogInfo "Test namespace $TEST_NS cleaned up"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,156 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Feature test: K8s Storage - PVC lifecycle with local-path provisioner
|
||||
# ============================================================
|
||||
# Purpose: Verify local-path-provisioner works on RISC-V
|
||||
# - PVC creation, binding, pod mounting, data persistence
|
||||
# ============================================================
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
|
||||
TEST_NS="k8s-feature-test-storage"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sSetup
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl create namespace "$TEST_NS" 2>/dev/null
|
||||
sleep 2
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify local-path-provisioner is running"
|
||||
sc_output=$(k8sKubectl get storageclass 2>&1)
|
||||
rlAssertGrep "local-path" "$sc_output" "local-path StorageClass exists"
|
||||
|
||||
lp_pods=$(k8sKubectl get pods -n kube-system -l app=local-path-provisioner --no-headers 2>&1)
|
||||
rlAssertGrep "Running" "$lp_pods" "local-path-provisioner pod is Running"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create PVC and verify binding"
|
||||
cat > /tmp/test-pvc.yaml << 'PVCEOF'
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: test-pvc
|
||||
namespace: PVCNS
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: local-path
|
||||
PVCEOF
|
||||
sed -i "s/PVCNS/$TEST_NS/g" /tmp/test-pvc.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/test-pvc.yaml 2>/dev/null
|
||||
# Wait for PVC to be bound
|
||||
for i in $(seq 1 30); do
|
||||
phase=$(k8sKubectl get pvc test-pvc -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$phase" = "Bound" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
pvc_output=$(k8sKubectl get pvc test-pvc -n "$TEST_NS" --no-headers 2>&1)
|
||||
rlAssertGrep "Bound" "$pvc_output" "PVC test-pvc is Bound"
|
||||
rlLogInfo "PVC status: $pvc_output"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Mount PVC to pod and write data"
|
||||
cat > /tmp/test-storage-pod.yaml << 'PODEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: storage-writer
|
||||
namespace: PODNS
|
||||
spec:
|
||||
containers:
|
||||
- name: writer
|
||||
image: busybox:1.36.1
|
||||
command: ["sh", "-c", "echo 'k8s-storage-test-data' > /data/test.txt && sleep 3600"]
|
||||
volumeMounts:
|
||||
- name: data-vol
|
||||
mountPath: /data
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
volumes:
|
||||
- name: data-vol
|
||||
persistentVolumeClaim:
|
||||
claimName: test-pvc
|
||||
restartPolicy: Never
|
||||
PODEOF
|
||||
sed -i "s/PODNS/$TEST_NS/g" /tmp/test-storage-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/test-storage-pod.yaml 2>/dev/null
|
||||
# Wait for pod to be Running
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod storage-writer -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
writer_output=$(k8sKubectl get pod storage-writer -n "$TEST_NS" --no-headers 2>&1)
|
||||
rlAssertGrep "Running" "$writer_output" "Storage writer pod is Running"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Delete writer pod and verify data persistence"
|
||||
k8sKubectl delete pod storage-writer -n "$TEST_NS" --wait 2>/dev/null
|
||||
sleep 3
|
||||
|
||||
# Create reader pod using same PVC
|
||||
cat > /tmp/test-reader-pod.yaml << 'READEREOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: storage-reader
|
||||
namespace: PODNS
|
||||
spec:
|
||||
containers:
|
||||
- name: reader
|
||||
image: busybox:1.36.1
|
||||
command: ["sh", "-c", "cat /data/test.txt && echo '---append---' >> /data/test.txt && sleep 10"]
|
||||
volumeMounts:
|
||||
- name: data-vol
|
||||
mountPath: /data
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
volumes:
|
||||
- name: data-vol
|
||||
persistentVolumeClaim:
|
||||
claimName: test-pvc
|
||||
restartPolicy: Never
|
||||
READEREOF
|
||||
sed -i "s/PODNS/$TEST_NS/g" /tmp/test-reader-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/test-reader-pod.yaml 2>/dev/null
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod storage-reader -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Check pod logs for the original data
|
||||
log_output=$(k8sKubectl logs storage-reader -n "$TEST_NS" 2>&1)
|
||||
rlLogInfo "Reader pod log: $log_output"
|
||||
rlAssertGrep "k8s-storage-test-data" "$log_output" "Data persisted after pod deletion (original data found)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
k8sKubectl delete pod storage-reader -n "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl delete pvc test-pvc -n "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
rm -f /tmp/test-pvc.yaml /tmp/test-storage-pod.yaml /tmp/test-reader-pod.yaml
|
||||
rlLogInfo "Test namespace $TEST_NS cleaned up"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,162 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================
|
||||
# Feature test: K8s Workload - ConfigMap, Secret, ServiceAccount
|
||||
# ============================================================
|
||||
# Purpose: Verify K8s workload configuration primitives work
|
||||
# correctly on RISC-V: ConfigMap/Secret mounting and env injection.
|
||||
# ============================================================
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
. "$(dirname "$0")/lib.sh"
|
||||
|
||||
TEST_NS="k8s-feature-test-workload"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment setup"
|
||||
k8sSetup
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
k8sKubectl create namespace "$TEST_NS" 2>/dev/null
|
||||
sleep 2
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create ConfigMap and mount as volume"
|
||||
k8sKubectl create configmap test-config -n "$TEST_NS" --from-literal=key1=value1 --from-literal=key2=value2 2>/dev/null
|
||||
|
||||
cat > /tmp/cm-pod.yaml << 'CMEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: cm-test-pod
|
||||
namespace: CMNS
|
||||
spec:
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sh", "-c", "cat /etc/config/key1 && cat /etc/config/key2 && sleep 60"]
|
||||
volumeMounts:
|
||||
- name: config-vol
|
||||
mountPath: /etc/config
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
volumes:
|
||||
- name: config-vol
|
||||
configMap:
|
||||
name: test-config
|
||||
restartPolicy: Never
|
||||
CMEOF
|
||||
sed -i "s/CMNS/$TEST_NS/g" /tmp/cm-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/cm-pod.yaml 2>/dev/null
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod cm-test-pod -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
log_output=$(k8sKubectl logs cm-test-pod -n "$TEST_NS" 2>&1)
|
||||
rlLogInfo "ConfigMap pod log: $log_output"
|
||||
rlAssertGrep "value1" "$log_output" "ConfigMap key1 = value1"
|
||||
rlAssertGrep "value2" "$log_output" "ConfigMap key2 = value2"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create Secret and inject as environment variable"
|
||||
k8sKubectl create secret generic test-secret -n "$TEST_NS" \
|
||||
--from-literal=username=admin --from-literal=password=s3cr3t 2>/dev/null
|
||||
|
||||
cat > /tmp/secret-pod.yaml << 'SECEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: secret-test-pod
|
||||
namespace: SECNS
|
||||
spec:
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sh", "-c", "echo USER=$SECRET_USER && echo PASS=$SECRET_PASS && sleep 60"]
|
||||
env:
|
||||
- name: SECRET_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: test-secret
|
||||
key: username
|
||||
- name: SECRET_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: test-secret
|
||||
key: password
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
restartPolicy: Never
|
||||
SECEOF
|
||||
sed -i "s/SECNS/$TEST_NS/g" /tmp/secret-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/secret-pod.yaml 2>/dev/null
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod secret-test-pod -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
secret_logs=$(k8sKubectl logs secret-test-pod -n "$TEST_NS" 2>&1)
|
||||
rlLogInfo "Secret pod env output: $secret_logs"
|
||||
rlAssertGrep "USER=admin" "$secret_logs" "Secret username injected as env"
|
||||
rlAssertGrep "PASS=s3cr3t" "$secret_logs" "Secret password injected as env"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Create ServiceAccount and verify in pod"
|
||||
k8sKubectl create serviceaccount test-sa -n "$TEST_NS" 2>/dev/null
|
||||
|
||||
cat > /tmp/sa-pod.yaml << 'SAEOF'
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: sa-test-pod
|
||||
namespace: SANS
|
||||
spec:
|
||||
serviceAccountName: test-sa
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox:1.36.1
|
||||
command: ["sh", "-c", "cat /var/run/secrets/kubernetes.io/serviceaccount/token && sleep 10"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
restartPolicy: Never
|
||||
SAEOF
|
||||
sed -i "s/SANS/$TEST_NS/g" /tmp/sa-pod.yaml
|
||||
|
||||
k8sKubectl apply -f /tmp/sa-pod.yaml 2>/dev/null
|
||||
for i in $(seq 1 30); do
|
||||
status=$(k8sKubectl get pod sa-test-pod -n "$TEST_NS" -o jsonpath='{.status.phase}' 2>/dev/null)
|
||||
if [ "$status" = "Running" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
sa_verify=$(k8sKubectl get pod sa-test-pod -n "$TEST_NS" -o jsonpath='{.spec.serviceAccountName}' 2>&1)
|
||||
if [ "$sa_verify" = "test-sa" ]; then
|
||||
rlPass "ServiceAccount test-sa is assigned to pod"
|
||||
else
|
||||
rlFail "ServiceAccount not assigned correctly (got: $sa_verify)"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
k8sKubectl delete namespace "$TEST_NS" --ignore-not-found --wait 2>/dev/null
|
||||
rm -f /tmp/cm-pod.yaml /tmp/secret-pod.yaml /tmp/sa-pod.yaml
|
||||
rlLogInfo "Test namespace $TEST_NS cleaned up"
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -1,27 +0,0 @@
|
||||
# ============================================================
|
||||
# K8s Feature Test - 测试服务器拓扑配置
|
||||
# ============================================================
|
||||
# 使用方法:
|
||||
# 1. 复制此文件到项目根目录并重命名为 topology.env
|
||||
# cp topology.env.example topology.env
|
||||
# 2. 根据实际 K8s 节点环境修改服务器信息
|
||||
#
|
||||
# 当前环境:
|
||||
# - Server 1 (K8s Master): 10.20.238.253:12055
|
||||
# - Server 2 (K8s Worker): 10.20.238.253:12056
|
||||
# ============================================================
|
||||
|
||||
# K8s 测试需要 2 台服务器
|
||||
TEST_SERVER_COUNT=2
|
||||
|
||||
# ====== Server 1 (K8s Master) ======
|
||||
TEST_SERVER_1_HOST=10.20.238.253
|
||||
TEST_SERVER_1_PORT=12055
|
||||
TEST_SERVER_1_USER=openruyi
|
||||
TEST_SERVER_1_PASSWORD=openruyi
|
||||
|
||||
# ====== Server 2 (K8s Worker) ======
|
||||
TEST_SERVER_2_HOST=10.20.238.253
|
||||
TEST_SERVER_2_PORT=12056
|
||||
TEST_SERVER_2_USER=openruyi
|
||||
TEST_SERVER_2_PASSWORD=openruyi
|
||||
+63
-63
@@ -1,63 +1,63 @@
|
||||
# Functional test - Package tests
|
||||
|
||||
This directory contains functional test cases for each package, Uses ACL sub-directory structure standard.
|
||||
|
||||
## Test coverage overview
|
||||
|
||||
- **202 packages**, **561 test cases**, **1,692 functional points**
|
||||
- All test scripts have been verified on openEuler RISC-V server
|
||||
- See [Functional test coverage details](../../docs/coverage/functional-coverage.md)
|
||||
|
||||
## directory structure
|
||||
|
||||
```
|
||||
tests/functional/
|
||||
├── main.fmf # Shared configuration (All subdirectories inherit)
|
||||
├── README.md # this file
|
||||
└── pkgs/ # RPM Package functional tests
|
||||
├── main.fmf # Shared configuration
|
||||
├── acl/ # acl Package tests (Reference standard)
|
||||
│ ├── main.fmf
|
||||
│ ├── test.sh
|
||||
│ └── test_acl_*/ # Sub-test directories
|
||||
├── attr/ # attr Package tests
|
||||
│ ├── main.fmf
|
||||
│ ├── test.sh
|
||||
│ └── test_attr_*/ # Sub-test directories
|
||||
└──... # More package tests
|
||||
```
|
||||
|
||||
## Test structure specification (Refer to ACL)
|
||||
|
||||
Each package test directory contains:
|
||||
- `main.fmf` -- Package-level metadata configuration
|
||||
- `test.sh` -- Package-level main test script
|
||||
- `test_<pkg>_<feature>/` -- Sub-test directories split by functional point
|
||||
- `main.fmf` -- Sub-test metadata
|
||||
- `test.sh` -- Sub-test script
|
||||
|
||||
## Add new package test
|
||||
|
||||
1. Create directory `tests/functional/pkgs/<package_name>/`
|
||||
2. create `main.fmf` (Refer to `pkgs/acl/main.fmf`)
|
||||
3. create `test.sh` (Refer to template)
|
||||
4. Create sub-test directories by functional point
|
||||
|
||||
## Run tests
|
||||
|
||||
```bash
|
||||
tmt run plan --name /plans/functional test --name /tests/functional/<package_name>
|
||||
```
|
||||
- Metadata files are uniformly named `main.fmf`
|
||||
|
||||
## Test coverage progress
|
||||
|
||||
| soft | Status | Number of test cases | Notes |
|
||||
|--------|------|-----------|------|
|
||||
| acl | ✅ Complete | 27+ | First example package |
|
||||
|... | To be added | - | - |
|
||||
|
||||
## Reference documentation
|
||||
|
||||
- Package test writing guide:`.trellis/tasks/06-09-acl/package-test-guide.md`
|
||||
- tmt Official documentation:https://tmt.readthedocs.io/
|
||||
# Functional test - Package tests
|
||||
|
||||
This directory contains functional test cases for each package, Uses ACL sub-directory structure standard.
|
||||
|
||||
## Test coverage overview
|
||||
|
||||
- **202 packages**, **561 test cases**, **1,692 functional points**
|
||||
- All test scripts have been verified on openEuler RISC-V server
|
||||
- See [Functional test coverage details](../../docs/coverage/functional-coverage.md)
|
||||
|
||||
## directory structure
|
||||
|
||||
```
|
||||
tests/functional/
|
||||
├── main.fmf # Shared configuration (All subdirectories inherit)
|
||||
├── README.md # this file
|
||||
└── pkgs/ # RPM Package functional tests
|
||||
├── main.fmf # Shared configuration
|
||||
├── acl/ # acl Package tests (Reference standard)
|
||||
│ ├── main.fmf
|
||||
│ ├── test.sh
|
||||
│ └── test_acl_*/ # Sub-test directories
|
||||
├── attr/ # attr Package tests
|
||||
│ ├── main.fmf
|
||||
│ ├── test.sh
|
||||
│ └── test_attr_*/ # Sub-test directories
|
||||
└──... # More package tests
|
||||
```
|
||||
|
||||
## Test structure specification (Refer to ACL)
|
||||
|
||||
Each package test directory contains:
|
||||
- `main.fmf` -- Package-level metadata configuration
|
||||
- `test.sh` -- Package-level main test script
|
||||
- `test_<pkg>_<feature>/` -- Sub-test directories split by functional point
|
||||
- `main.fmf` -- Sub-test metadata
|
||||
- `test.sh` -- Sub-test script
|
||||
|
||||
## Add new package test
|
||||
|
||||
1. Create directory `tests/functional/pkgs/<package_name>/`
|
||||
2. create `main.fmf` (Refer to `pkgs/acl/main.fmf`)
|
||||
3. create `test.sh` (Refer to template)
|
||||
4. Create sub-test directories by functional point
|
||||
|
||||
## Run tests
|
||||
|
||||
```bash
|
||||
tmt run plan --name /plans/functional test --name /tests/functional/<package_name>
|
||||
```
|
||||
- Metadata files are uniformly named `main.fmf`
|
||||
|
||||
## Test coverage progress
|
||||
|
||||
| soft | Status | Number of test cases | Notes |
|
||||
|--------|------|-----------|------|
|
||||
| acl | ✅ Complete | 27+ | First example package |
|
||||
|... | To be added | - | - |
|
||||
|
||||
## Reference documentation
|
||||
|
||||
- Package test writing guide:`.trellis/tasks/06-09-acl/package-test-guide.md`
|
||||
- tmt Official documentation:https://tmt.readthedocs.io/
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
summary: Functional test - cmake export integrity verification
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- cmake_verify
|
||||
duration: 10m
|
||||
tier: 1
|
||||
path: /tests/functional/cmake
|
||||
require:
|
||||
- cmake
|
||||
- gcc
|
||||
- gcc-c++
|
||||
- beakerlib
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - abseil-cpp-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- abseil-cpp
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_abseil-cpp-devel_cmake_verify
|
||||
require:
|
||||
- abseil-cpp-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: abseil-cpp-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="abseil-cpp-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(absl) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(absl REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(absl) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(absl CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package absl CONFIG)"; then
|
||||
rlPass "find_package(absl CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(absl CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - angelscript-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- angelscript
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_angelscript-devel_cmake_verify
|
||||
require:
|
||||
- angelscript-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: angelscript-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="angelscript-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Angelscript) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Angelscript REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Angelscript) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Angelscript CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Angelscript CONFIG)"; then
|
||||
rlPass "find_package(Angelscript CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Angelscript CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - aom-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- aom
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_aom-devel_cmake_verify
|
||||
require:
|
||||
- aom-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: aom-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="aom-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(AOM) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(AOM REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(AOM) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(AOM CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package AOM CONFIG)"; then
|
||||
rlPass "find_package(AOM CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(AOM CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - appstream-qt-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- appstream-qt
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_appstream-qt-devel_cmake_verify
|
||||
require:
|
||||
- appstream-qt-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: appstream-qt-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="appstream-qt-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(AppStreamQt) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(AppStreamQt REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(AppStreamQt) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(AppStreamQt CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package AppStreamQt CONFIG)"; then
|
||||
rlPass "find_package(AppStreamQt CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(AppStreamQt CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - arrow-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- arrow
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_arrow-devel_cmake_verify
|
||||
require:
|
||||
- arrow-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,163 @@
|
||||
#!/bin/bash
|
||||
# Functional test: arrow-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="arrow-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Arrow) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Arrow REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Arrow) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Arrow CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Arrow CONFIG)"; then
|
||||
rlPass "find_package(Arrow CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Arrow CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(ArrowAcero) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(ArrowAcero REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(ArrowAcero) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(ArrowAcero CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_1"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_1" 0 \
|
||||
"cmake configuration (find_package ArrowAcero CONFIG)"; then
|
||||
rlPass "find_package(ArrowAcero CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(ArrowAcero CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(ArrowCompute) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(ArrowCompute REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(ArrowCompute) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(ArrowCompute CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_2"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_2" 0 \
|
||||
"cmake configuration (find_package ArrowCompute CONFIG)"; then
|
||||
rlPass "find_package(ArrowCompute CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(ArrowCompute CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(ArrowDataset) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(ArrowDataset REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(ArrowDataset) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(ArrowDataset CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_3"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_3" 0 \
|
||||
"cmake configuration (find_package ArrowDataset CONFIG)"; then
|
||||
rlPass "find_package(ArrowDataset CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(ArrowDataset CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Parquet) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Parquet REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Parquet) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Parquet CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_4"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_4" 0 \
|
||||
"cmake configuration (find_package Parquet CONFIG)"; then
|
||||
rlPass "find_package(Parquet CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Parquet CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(arrow) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(arrow REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(arrow) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(arrow CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_5"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_5" 0 \
|
||||
"cmake configuration (find_package arrow CONFIG)"; then
|
||||
rlPass "find_package(arrow CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(arrow CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - asmjit-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- asmjit
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_asmjit-devel_cmake_verify
|
||||
require:
|
||||
- asmjit-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: asmjit-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="asmjit-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(asmjit) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(asmjit REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(asmjit) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(asmjit CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package asmjit CONFIG)"; then
|
||||
rlPass "find_package(asmjit CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(asmjit CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - baloo-widgets-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- baloo-widgets
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_baloo-widgets-devel_cmake_verify
|
||||
require:
|
||||
- baloo-widgets-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: baloo-widgets-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="baloo-widgets-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(KF6BalooWidgets) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(KF6BalooWidgets REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(KF6BalooWidgets) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(KF6BalooWidgets CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package KF6BalooWidgets CONFIG)"; then
|
||||
rlPass "find_package(KF6BalooWidgets CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(KF6BalooWidgets CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - bash-completion-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- bash-completion
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_bash-completion-devel_cmake_verify
|
||||
require:
|
||||
- bash-completion-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: bash-completion-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="bash-completion-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(bash-completion) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(bash-completion REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(bash-completion) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(bash-completion CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package bash-completion CONFIG)"; then
|
||||
rlPass "find_package(bash-completion CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(bash-completion CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - blake3-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- blake3
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_blake3-devel_cmake_verify
|
||||
require:
|
||||
- blake3-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: blake3-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="blake3-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(blake3) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(blake3 REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(blake3) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(blake3 CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package blake3 CONFIG)"; then
|
||||
rlPass "find_package(blake3 CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(blake3 CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - boost-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- boost
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_boost-devel_cmake_verify
|
||||
require:
|
||||
- boost-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: boost-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="boost-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Boost) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Boost REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Boost) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Boost CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Boost CONFIG)"; then
|
||||
rlPass "find_package(Boost CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Boost CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - breeze-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- breeze
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_breeze-devel_cmake_verify
|
||||
require:
|
||||
- breeze-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: breeze-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="breeze-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Breeze) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Breeze REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Breeze) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Breeze CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Breeze CONFIG)"; then
|
||||
rlPass "find_package(Breeze CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Breeze CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - c-ares-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- c-ares
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_c-ares-devel_cmake_verify
|
||||
require:
|
||||
- c-ares-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: c-ares-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="c-ares-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(c-ares) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(c-ares REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(c-ares) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(c-ares CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package c-ares CONFIG)"; then
|
||||
rlPass "find_package(c-ares CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(c-ares CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,16 @@
|
||||
summary: Functional test - calamares-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- calamares
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_calamares-devel_cmake_verify
|
||||
require:
|
||||
- calamares-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
- qt6-linguist
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: calamares-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="calamares-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Calamares) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Calamares REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Calamares) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Calamares CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Calamares CONFIG)"; then
|
||||
rlPass "find_package(Calamares CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Calamares CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - capstone-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- capstone
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_capstone-devel_cmake_verify
|
||||
require:
|
||||
- capstone-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: capstone-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="capstone-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(capstone) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(capstone REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(capstone) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(capstone CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package capstone CONFIG)"; then
|
||||
rlPass "find_package(capstone CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(capstone CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - Catch2-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- Catch2
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_catch2-devel_cmake_verify
|
||||
require:
|
||||
- Catch2-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: Catch2-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="Catch2-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Catch2) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Catch2 REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Catch2) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Catch2 CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Catch2 CONFIG)"; then
|
||||
rlPass "find_package(Catch2 CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Catch2 CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - cereal-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- cereal
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_cereal-devel_cmake_verify
|
||||
require:
|
||||
- cereal-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: cereal-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="cereal-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(cereal) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(cereal REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(cereal) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(cereal CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package cereal CONFIG)"; then
|
||||
rlPass "find_package(cereal CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(cereal CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - clang-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- clang
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_clang-devel_cmake_verify
|
||||
require:
|
||||
- clang-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: clang-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="clang-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Clang) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Clang REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Clang) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Clang CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Clang CONFIG)"; then
|
||||
rlPass "find_package(Clang CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Clang CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - clang22-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- clang22
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_clang22-devel_cmake_verify
|
||||
require:
|
||||
- clang22-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: clang22-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="clang22-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Clang) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Clang REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Clang) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Clang CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Clang CONFIG)"; then
|
||||
rlPass "find_package(Clang CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Clang CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - cli11-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- cli11
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_cli11-devel_cmake_verify
|
||||
require:
|
||||
- cli11-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: cli11-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="cli11-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(CLI11) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(CLI11 REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(CLI11) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(CLI11 CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package CLI11 CONFIG)"; then
|
||||
rlPass "find_package(CLI11 CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(CLI11 CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - cmake-rpm-macros cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- note
|
||||
- cmake-rpm-macros
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_cmake-rpm-macros_cmake_verify
|
||||
require:
|
||||
- cmake-rpm-macros
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
# Functional test: cmake-rpm-macros - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# Only Other type .cmake (build helper/documentation), no find_package validation needed
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="cmake-rpm-macros"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
rlLogInfo "Type: Other, 2 .cmake file(s)"
|
||||
rlLogInfo "Only Other/Module type .cmake (build helper/documentation), no find_package validation needed"
|
||||
rlPass "Confirmed as Other type, skipping validation"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - cmocka-cmake cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- cmocka-cmake
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_cmocka-cmake_cmake_verify
|
||||
require:
|
||||
- cmocka-cmake
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: cmocka-cmake - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="cmocka-cmake"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(cmocka) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(cmocka REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(cmocka) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(cmocka CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package cmocka CONFIG)"; then
|
||||
rlPass "find_package(cmocka CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(cmocka CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - concurrentqueue-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- concurrentqueue
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_concurrentqueue-devel_cmake_verify
|
||||
require:
|
||||
- concurrentqueue-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: concurrentqueue-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="concurrentqueue-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(concurrentqueue) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(concurrentqueue REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(concurrentqueue) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(concurrentqueue CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package concurrentqueue CONFIG)"; then
|
||||
rlPass "find_package(concurrentqueue CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(concurrentqueue CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - cpp-httplib-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- cpp-httplib
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_cpp-httplib-devel_cmake_verify
|
||||
require:
|
||||
- cpp-httplib-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: cpp-httplib-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="cpp-httplib-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(httplib) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(httplib REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(httplib) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(httplib CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package httplib CONFIG)"; then
|
||||
rlPass "find_package(httplib CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(httplib CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - cpuinfo-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- cpuinfo
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_cpuinfo-devel_cmake_verify
|
||||
require:
|
||||
- cpuinfo-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: cpuinfo-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="cpuinfo-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(cpuinfo) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(cpuinfo REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(cpuinfo) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(cpuinfo CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package cpuinfo CONFIG)"; then
|
||||
rlPass "find_package(cpuinfo CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(cpuinfo CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - date-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- date
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_date-devel_cmake_verify
|
||||
require:
|
||||
- date-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: date-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="date-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(date) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(date REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(date) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(date CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package date CONFIG)"; then
|
||||
rlPass "find_package(date CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(date CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - dbus-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- dbus
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_dbus-devel_cmake_verify
|
||||
require:
|
||||
- dbus-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: dbus-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="dbus-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(DBus1) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(DBus1 REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(DBus1) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(DBus1 CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package DBus1 CONFIG)"; then
|
||||
rlPass "find_package(DBus1 CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(DBus1 CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - ddcutil-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- ddcutil
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_ddcutil-devel_cmake_verify
|
||||
require:
|
||||
- ddcutil-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
# Functional test: ddcutil-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(MODULE) -> load Find*.cmake modules
|
||||
# Module syntax errors or internal reference issues will cause cmake configuration to fail
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="ddcutil-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
TmpDir2=$(mktemp -d)
|
||||
rlRun "cd $TmpDir2" 0 "Enter temporary test directory"
|
||||
|
||||
# --- find_package(DDCUtil MODULE) ---
|
||||
cat > "$TmpDir2/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_module_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C)
|
||||
list(APPEND CMAKE_MODULE_PATH "/usr/lib64/cmake/ddcutil")
|
||||
find_package(DDCUtil MODULE QUIET)
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(DDCUtil MODULE) ..."
|
||||
rm -rf "$TmpDir2/build_0"
|
||||
if rlRun "cmake -S $TmpDir2 -B $TmpDir2/build_0" 0 \
|
||||
"cmake configuration (find_package DDCUtil MODULE)"; then
|
||||
rlPass "find_package(DDCUtil MODULE) verification passed"
|
||||
else
|
||||
rlLogWarning "find_package(DDCUtil MODULE) verification failed(the library being searched may not be installed)"
|
||||
fi
|
||||
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
rm -rf "$TmpDir2"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - dlpack cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- dlpack
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_dlpack_cmake_verify
|
||||
require:
|
||||
- dlpack
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: dlpack - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="dlpack"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(dlpack) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(dlpack REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(dlpack) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(dlpack CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package dlpack CONFIG)"; then
|
||||
rlPass "find_package(dlpack CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(dlpack CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - doctest cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- doctest
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_doctest_cmake_verify
|
||||
require:
|
||||
- doctest
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: doctest - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="doctest"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(doctest) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(doctest REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(doctest) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(doctest CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package doctest CONFIG)"; then
|
||||
rlPass "find_package(doctest CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(doctest CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - dolphin-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- dolphin
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_dolphin-devel_cmake_verify
|
||||
require:
|
||||
- dolphin-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: dolphin-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="dolphin-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(DolphinVcs) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(DolphinVcs REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(DolphinVcs) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(DolphinVcs CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package DolphinVcs CONFIG)"; then
|
||||
rlPass "find_package(DolphinVcs CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(DolphinVcs CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - double-conversion-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- double-conversion
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_double-conversion-devel_cmake_verify
|
||||
require:
|
||||
- double-conversion-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: double-conversion-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="double-conversion-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(double-conversion) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(double-conversion REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(double-conversion) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(double-conversion CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package double-conversion CONFIG)"; then
|
||||
rlPass "find_package(double-conversion CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(double-conversion CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,16 @@
|
||||
summary: Functional test - draco-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- draco
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_draco-devel_cmake_verify
|
||||
require:
|
||||
- draco-devel
|
||||
- draco-static
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: draco-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="draco-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(draco) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(draco REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(draco) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(draco CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package draco CONFIG)"; then
|
||||
rlPass "find_package(draco CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(draco CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,18 @@
|
||||
summary: Functional test - dwarfs-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- dwarfs
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_dwarfs-devel_cmake_verify
|
||||
require:
|
||||
- dwarfs-devel
|
||||
- libarchive-devel
|
||||
- openssl-devel
|
||||
- xxhash-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: dwarfs-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="dwarfs-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(dwarfs) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(dwarfs REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(dwarfs) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(dwarfs CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package dwarfs CONFIG)"; then
|
||||
rlPass "find_package(dwarfs CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(dwarfs CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,16 @@
|
||||
summary: Functional test - editorconfig-core-c-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- editorconfig-core-c
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_editorconfig-core-c-devel_cmake_verify
|
||||
require:
|
||||
- editorconfig-core-c-devel
|
||||
- editorconfig-core-c-static
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: editorconfig-core-c-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="editorconfig-core-c-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(EditorConfig) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(EditorConfig REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(EditorConfig) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(EditorConfig CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package EditorConfig CONFIG)"; then
|
||||
rlPass "find_package(EditorConfig CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(EditorConfig CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - eigen3 cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- eigen3
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_eigen3_cmake_verify
|
||||
require:
|
||||
- eigen3
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: eigen3 - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="eigen3"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Eigen3) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Eigen3 REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Eigen3) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Eigen3 CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Eigen3 CONFIG)"; then
|
||||
rlPass "find_package(Eigen3 CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Eigen3 CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - exiv2-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- exiv2
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_exiv2-devel_cmake_verify
|
||||
require:
|
||||
- exiv2-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: exiv2-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="exiv2-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(exiv2) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(exiv2 REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(exiv2) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(exiv2 CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package exiv2 CONFIG)"; then
|
||||
rlPass "find_package(exiv2 CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(exiv2 CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - expat-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- expat
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_expat-devel_cmake_verify
|
||||
require:
|
||||
- expat-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: expat-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="expat-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(expat) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(expat REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(expat) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(expat CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package expat CONFIG)"; then
|
||||
rlPass "find_package(expat CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(expat CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - fast_float cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- fast_float
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_fast_float_cmake_verify
|
||||
require:
|
||||
- fast_float
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: fast_float - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="fast_float"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(FastFloat) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(FastFloat REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(FastFloat) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(FastFloat CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package FastFloat CONFIG)"; then
|
||||
rlPass "find_package(FastFloat CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(FastFloat CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - fcitx5-chinese-addons-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- fcitx5-chinese-addons
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_fcitx5-chinese-addons-devel_cmake_verify
|
||||
require:
|
||||
- fcitx5-chinese-addons-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
# Functional test: fcitx5-chinese-addons-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="fcitx5-chinese-addons-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Fcitx5ModuleCloudPinyin) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleCloudPinyin REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleCloudPinyin) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleCloudPinyin CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleCloudPinyin CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleCloudPinyin CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleCloudPinyin CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModulePinyinHelper) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModulePinyinHelper REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModulePinyinHelper) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModulePinyinHelper CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_1"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_1" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModulePinyinHelper CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModulePinyinHelper CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModulePinyinHelper CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModulePunctuation) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModulePunctuation REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModulePunctuation) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModulePunctuation CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_2"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_2" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModulePunctuation CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModulePunctuation CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModulePunctuation CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - fcitx5-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- fcitx5
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_fcitx5-devel_cmake_verify
|
||||
require:
|
||||
- fcitx5-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,376 @@
|
||||
#!/bin/bash
|
||||
# Functional test: fcitx5-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="fcitx5-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Fcitx5Config) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5Config REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5Config) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5Config CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Fcitx5Config CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5Config CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5Config CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5Core) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5Core REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5Core) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5Core CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_1"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_1" 0 \
|
||||
"cmake configuration (find_package Fcitx5Core CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5Core CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5Core CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5Module) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5Module REQUIRED CONFIG
|
||||
COMPONENTS
|
||||
Clipboard
|
||||
)
|
||||
|
||||
message(STATUS "find_package(Fcitx5Module) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5Module CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_2"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_2" 0 \
|
||||
"cmake configuration (find_package Fcitx5Module CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5Module CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5Module CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleClipboard) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleClipboard REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleClipboard) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleClipboard CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_3"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_3" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleClipboard CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleClipboard CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleClipboard CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleDBus) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleDBus REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleDBus) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleDBus CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_4"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_4" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleDBus CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleDBus CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleDBus CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleEmoji) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleEmoji REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleEmoji) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleEmoji CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_5"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_5" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleEmoji CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleEmoji CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleEmoji CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleNotificationItem) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleNotificationItem REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleNotificationItem) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleNotificationItem CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_6"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_6" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleNotificationItem CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleNotificationItem CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleNotificationItem CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleNotifications) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleNotifications REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleNotifications) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleNotifications CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_7"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_7" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleNotifications CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleNotifications CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleNotifications CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleQuickPhrase) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleQuickPhrase REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleQuickPhrase) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleQuickPhrase CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_8"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_8" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleQuickPhrase CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleQuickPhrase CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleQuickPhrase CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleSpell) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleSpell REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleSpell) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleSpell CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_9"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_9" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleSpell CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleSpell CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleSpell CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleTestFrontend) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleTestFrontend REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleTestFrontend) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleTestFrontend CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_10"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_10" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleTestFrontend CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleTestFrontend CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleTestFrontend CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleTestIM) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleTestIM REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleTestIM) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleTestIM CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_11"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_11" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleTestIM CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleTestIM CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleTestIM CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleUnicode) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleUnicode REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleUnicode) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleUnicode CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_12"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_12" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleUnicode CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleUnicode CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleUnicode CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleWayland) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleWayland REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleWayland) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleWayland CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_13"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_13" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleWayland CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleWayland CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleWayland CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5ModuleXCB) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5ModuleXCB REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5ModuleXCB) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5ModuleXCB CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_14"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_14" 0 \
|
||||
"cmake configuration (find_package Fcitx5ModuleXCB CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5ModuleXCB CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5ModuleXCB CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
# --- find_package(Fcitx5Utils) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5Utils REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5Utils) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5Utils CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_15"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_15" 0 \
|
||||
"cmake configuration (find_package Fcitx5Utils CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5Utils CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5Utils CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - fcitx5-gtk-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- fcitx5-gtk
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_fcitx5-gtk-devel_cmake_verify
|
||||
require:
|
||||
- fcitx5-gtk-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Functional test: fcitx5-gtk-devel - cmake export integrity verification
|
||||
# Verify that all files referenced by .cmake files provided by the package actually exist
|
||||
#
|
||||
# Verification principle:
|
||||
# find_package(CONFIG) -> *Config.cmake -> *Targets.cmake
|
||||
# Targets.cmake referencing non-existent .a/.so will cause cmake configuration to fail directly
|
||||
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PKG="fcitx5-gtk-devel"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup "Environment Setup"
|
||||
TmpDir=$(mktemp -d)
|
||||
rlRun "cd $TmpDir" 0 "Enter temporary test directory"
|
||||
|
||||
CMAKE_COUNT=$(rpm -ql "$PKG" 2>/dev/null | grep -c '\.cmake$' || echo 0)
|
||||
rlLogInfo "$PKG provides $CMAKE_COUNT .cmake file(s)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "find_package(CONFIG) - Verify cmake export integrity"
|
||||
if [ "$CMAKE_COUNT" -eq 0 ]; then
|
||||
rlLogWarning "$PKG provides no .cmake files, skipping cmake verification"
|
||||
else
|
||||
# --- find_package(Fcitx5GClient) ---
|
||||
cat > "$TmpDir/CMakeLists.txt" << 'EOF'
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
project(cmake_verify
|
||||
VERSION "0.1"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
find_package(Fcitx5GClient REQUIRED CONFIG)
|
||||
|
||||
message(STATUS "find_package(Fcitx5GClient) succeeded")
|
||||
EOF
|
||||
|
||||
rlLogInfo "Verifying find_package(Fcitx5GClient CONFIG) ..."
|
||||
rm -rf "$TmpDir/build_0"
|
||||
if rlRun "cmake -S $TmpDir -B $TmpDir/build_0" 0 \
|
||||
"cmake configuration (find_package Fcitx5GClient CONFIG)"; then
|
||||
rlPass "find_package(Fcitx5GClient CONFIG) verification passed"
|
||||
else
|
||||
rlFail "find_package(Fcitx5GClient CONFIG) verification failed"
|
||||
fi
|
||||
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Clean up test environment"
|
||||
rlRun "cd /" 0 "Leave test directory"
|
||||
if [ -n "$TmpDir" ] && [ -d "$TmpDir" ]; then
|
||||
rlRun "rm -rf $TmpDir" 0 "Clean up temporary test directory"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
@@ -0,0 +1,15 @@
|
||||
summary: Functional test - fcitx5-lua-devel cmake verify
|
||||
test: ./test.sh
|
||||
tag:
|
||||
- functional
|
||||
- cmake
|
||||
- fcitx5-lua
|
||||
duration: 10m
|
||||
tier: 2
|
||||
path: /tests/functional/cmake/test_fcitx5-lua-devel_cmake_verify
|
||||
require:
|
||||
- fcitx5-lua-devel
|
||||
- cmake
|
||||
- gcc
|
||||
- beakerlib
|
||||
- gcc-c++
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user