Add gating.yaml and tests

Resolves: rhbz#1938758 (check-gitbz workaround, this bz is unrelated)
This commit is contained in:
Zoltan Fridrich 2021-07-23 13:49:02 +02:00
parent 51cab57c74
commit 950019dfcd
4 changed files with 51 additions and 0 deletions

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
set -x
TEST_SOURCE=test.c
TEST_TARGET="${TEST_SOURCE/\.c/}"
CXXFLAGS="$(rpm --eval '%{build_cxxflags}')"
LDFLAGS="$(rpm --eval '%{build_ldflags}')"
PKGFLAGS="$(pkg-config libseccomp --cflags --libs)"
# build target using distribution-specific flags
gcc -Werror $CXXFLAGS $LDFLAGS $PKGFLAGS -o $TEST_TARGET $TEST_SOURCE
# test that target exists
test -f ./$TEST_TARGET
# test that target is executable
test -x ./$TEST_TARGET
# test that target runs successfully
./$TEST_TARGET

View File

@ -0,0 +1,9 @@
#include <stdio.h>
#include <seccomp.h>
int main(void)
{
const struct scmp_version *version = seccomp_version();
printf("Version: %d.%d.%d\n", version->major, version->minor, version->micro);
return 0;
}

14
tests/tests.yml Normal file
View File

@ -0,0 +1,14 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- devel-usability
required_packages:
- gcc
- rpm
- redhat-rpm-config
- pkgconf-pkg-config
- libseccomp-devel