mirror of
https://github.com/Cacti/spine.git
synced 2026-10-23 03:27:10 +09:00
Introduce bounded native interfaces and grouped runtime state, then link regression and fault contracts against the real poller implementations. The contracts capture CLI/configuration input, availability combinations, SNMP request/response ownership, script framing, reindexing, output persistence, worker completion and shutdown. This foundational change is larger because the shared interfaces and their existing production contracts must move together; later changes have separate review boundaries. Step 1/14 of the complete C17/native-correctness series. Base: develop. Earlier validation, before this review follow-up, in isolated copied snapshots on Linux arm64: - Clean GCC build and make check: 13 passed, 0 existing prerequisite skips, 0 failures. - ASan/UBSan: 12 passed, 1 existing privilege/allocator-interposition prerequisite skips, 0 failures; no sanitizer findings. - Production source/profile integrity verification against disposable MariaDB and loopback SNMP fixtures passed. - Release archive extracted into a separate source tree and built/tested out of tree; fuzz checks passed. Earlier local profiles retain source hashes for the copied validation tree; GitHub checks validate the published commit. No production database/device, host installation or live privilege change is part of validation. Existing prerequisite skips were retained; no test or finding was suppressed to obtain a pass. The worker contracts publish owned heap state and release it only after joining workers and restoring the runtime table. Coverage counters use atomic updates; cppcheck receives an explicit model of the fatal exit contract. Fixture images use public mirrors to avoid shared Docker Hub pull limits. Series navigation: review and merge in order. Every PR targets the preceding branch so its diff contains one step. 1. [refactor(core): add bounded native interfaces and polling contracts](https://github.com/Cacti/spine/pull/638) 2. [fix(privileges): drop root before input and retain owned ICMP sockets](https://github.com/Cacti/spine/pull/639) 3. [fix(poller): isolate worker failures and bound database reconnects](https://github.com/Cacti/spine/pull/640) 4. [fix(results): normalize output and unify SNMP batch persistence](https://github.com/Cacti/spine/pull/641) 5. [fix(runtime): bound probe retries and validate CLI and configuration](https://github.com/Cacti/spine/pull/642) 6. [build: select GNU C17 explicitly and probe hardening support](https://github.com/Cacti/spine/pull/643) 7. [fix(threads): size worker stacks and guard size arithmetic](https://github.com/Cacti/spine/pull/644) 8. [refactor(c17): simplify ownership guards and share test support](https://github.com/Cacti/spine/pull/645) 9. [refactor(core): extract configuration polling and runtime modules](https://github.com/Cacti/spine/pull/646) 10. [fix(boundaries): validate script slots and make cleanup portable](https://github.com/Cacti/spine/pull/647) 11. [refactor(layout): organize responsibilities and separate main from runtime](https://github.com/Cacti/spine/pull/648) 12. [docs(license): adopt SPDX notices and retain contributor credits](https://github.com/Cacti/spine/pull/649) 13. [test(runtime): measure all suites and cover protocol boundaries](https://github.com/Cacti/spine/pull/650) 14. [build(ci): validate connectors time width and native C17 modules](https://github.com/Cacti/spine/pull/651) Review follow-up (2026-10-09): Publish the decoded GET/GETNEXT status back to the host so availability checks observe exception and missing-response failures, while preserving the legacy transport-success behavior for agent PDU errors. Updated step 1 snapshot: isolated Linux arm64 build and make check passed (13 passed, no skips or failures). The restacked tip passes all five clang-tidy gate regression tests and real clang-tidy analysis (26 reviewed baseline findings, no new findings). Actionlint and matching DCO trailers pass. The setuid test also passes when run in the separate disposable root container. GitHub checks validate the updated published commits; earlier profile/archive/sanitizer evidence above belongs to the previous revisions. --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
92 lines
3.1 KiB
YAML
92 lines
3.1 KiB
YAML
name: Production regressions
|
|
|
|
on:
|
|
push:
|
|
branches: [develop]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
regressions:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 15
|
|
services:
|
|
database:
|
|
image: mirror.gcr.io/library/mariadb:10.11
|
|
env:
|
|
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: '1'
|
|
MARIADB_DATABASE: spine_regressions
|
|
ports:
|
|
- 3306:3306
|
|
options: >-
|
|
--health-cmd="mariadb-admin ping --silent"
|
|
--health-interval=5s
|
|
--health-timeout=5s
|
|
--health-retries=20
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- name: Install build dependencies
|
|
run: |
|
|
set -eu
|
|
sudo apt-get update
|
|
sudo apt-get install -y autoconf automake libtool help2man libmariadb-dev mariadb-client libsnmp-dev snmpd libssl-dev libcap2-bin lcov
|
|
- name: Build and test production code
|
|
run: |
|
|
set -eu
|
|
mkdir -p config m4
|
|
autoreconf -fi
|
|
./configure
|
|
make -j2 check
|
|
- name: Verify database configuration loading
|
|
env:
|
|
SPINE_TEST_DB_HOST: 127.0.0.1
|
|
run: |
|
|
set -eu
|
|
mariadb --protocol=TCP --host=127.0.0.1 --user=root spine_regressions < tests/fixtures/configuration.sql
|
|
mariadb --protocol=TCP --host=127.0.0.1 --user=root spine_regressions < tests/fixtures/poller.sql
|
|
./test_spine_regressions --database
|
|
- name: Verify SNMP availability against local agent
|
|
env:
|
|
SPINE_TEST_SNMP_HOST: 127.0.0.1
|
|
SPINE_TEST_DB_HOST: 127.0.0.1
|
|
run: |
|
|
set -eu
|
|
snmpd -f -Lo -C -c tests/fixtures/snmpd.conf > snmp-agent.log 2>&1 &
|
|
agent_pid=$!
|
|
trap 'kill "$agent_pid"; wait "$agent_pid" || true' EXIT
|
|
sleep 1
|
|
./test_spine_regressions --snmp-agent
|
|
./test_spine_regressions --database
|
|
./test_spine_faults --database
|
|
- name: Verify authenticated SNMPv3 against owned agent
|
|
env:
|
|
SPINE_SNMPV3_EVIDENCE_DIR: snmpv3-evidence
|
|
run: tests/tools/run_snmpv3.sh
|
|
- name: Verify ICMP against local loopback
|
|
run: |
|
|
set -eu
|
|
./test_spine_regressions --icmp-no-capability
|
|
sudo setcap cap_net_raw+ep ./test_spine_regressions
|
|
./test_spine_regressions --raw-icmp
|
|
- name: Measure every production translation unit
|
|
env:
|
|
SPINE_TEST_SNMP_HOST: 127.0.0.1
|
|
SPINE_TEST_DB_HOST: 127.0.0.1
|
|
run: |
|
|
set -eu
|
|
snmpd -f -Lo -C -c tests/fixtures/snmpd.conf > coverage-snmp-agent.log 2>&1 &
|
|
agent_pid=$!
|
|
trap 'kill "$agent_pid"; wait "$agent_pid" || true' EXIT
|
|
sleep 1
|
|
tests/tools/run_coverage.sh
|
|
- name: Preserve coverage and source provenance
|
|
if: always()
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
with:
|
|
name: production-coverage-${{ github.sha }}
|
|
path: coverage/
|
|
if-no-files-found: error
|