Import rpm: 1d34933d39a8e7bf136a37ab91f6ee076d183744

This commit is contained in:
James Antill 2023-02-20 01:57:41 -05:00
commit 9e64e86e84
16 changed files with 2321 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
SOURCES/dnsname-18822f9.tar.gz
SOURCES/gvisor-tap-vsock-fdc231ae7b8fe1aec4cf0b8777274fa21b70d789.tar.gz
SOURCES/podman-machine-cni-0749884.tar.gz
SOURCES/v0.1.7.tar.gz
SOURCES/v4.0-rhel-ee04ef9.tar.gz

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# recipients: jnovy, lsm5, santiago
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

5
plans/basic.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Check basic functionality
discover:
how: fmf
execute:
how: tmt

2075
podman.spec Normal file

File diff suppressed because it is too large Load Diff

3
rpminspect.yaml Normal file
View File

@ -0,0 +1,3 @@
---
annocheck:
- hardened: --skip-pie --skip-lto --ignore-unknown --verbose

5
sources Normal file
View File

@ -0,0 +1,5 @@
SHA1 (dnsname-18822f9.tar.gz) = 00c35447384f51ccc2360965b80868fc91293711
SHA1 (gvisor-tap-vsock-fdc231ae7b8fe1aec4cf0b8777274fa21b70d789.tar.gz) = 4f46b03a20ca141f7ea10800282c0ba5aff9dcc2
SHA1 (podman-machine-cni-0749884.tar.gz) = 70b08b173bdf0d1325fce035c186b43085865587
SHA1 (v0.1.7.tar.gz) = 94419a237f932ff2a79c91f6e3005034d9c367a5
SHA1 (v4.0-rhel-ee04ef9.tar.gz) = cc39bf2c3443335cdaf982082d7d8f5b518cfb28

2
tests/main.fmf Normal file
View File

@ -0,0 +1,2 @@
require:
- podman

View File

@ -0,0 +1,12 @@
---
# Sigh; RHEL8 doesn't have BATS
- name: bats | fetch and unpack tarball
unarchive:
src: https://github.com/bats-core/bats-core/archive/v1.5.0.tar.gz
dest: /root
remote_src: true
- name: bats | install
command: ./install.sh /usr/local
args:
chdir: /root/bats-core-1.5.0

View File

@ -0,0 +1,7 @@
---
- name: create rootless user
user:
name: testuser
shell: /bin/bash
- name: enable linger
command: loginctl enable-linger testuser

View File

@ -0,0 +1,72 @@
#!/bin/bash
#
# Run bats tests for a given $TEST_PACKAGE, e.g. buildah, podman
#
# This is invoked by the 'run_bats_tests' role; we assume that
# the package foo has a foo-tests subpackage which provides the
# directory /usr/share/foo/test/system, containing one or more .bats
# test files.
#
export PATH=/usr/local/bin:/usr/sbin:/usr/bin
FULL_LOG=/tmp/test.debug.log
BATS_LOG=/tmp/test.bats.log
rm -f $FULL_LOG $BATS_LOG
touch $FULL_LOG $BATS_LOG
exec &> $FULL_LOG
# Log program versions
echo "Packages:"
rpm -q ${TEST_PACKAGE} ${TEST_PACKAGE}-tests
echo "------------------------------"
printenv | sort
testdir=/usr/share/${TEST_PACKAGE}/test/system
if ! cd $testdir; then
echo "FAIL ${TEST_NAME} : cd $testdir" >> /tmp/test.log
exit 0
fi
if [ -e /tmp/helper.sh ]; then
echo "------------------------------"
echo ". /tmp/helper.sh"
. /tmp/helper.sh
fi
if [ "$(type -t setup)" = "function" ]; then
echo "------------------------------"
echo "\$ setup"
setup
if [ $? -ne 0 ]; then
echo "FAIL ${TEST_NAME} : setup" >> /tmp/test.log
exit 0
fi
fi
echo "------------------------------"
echo "\$ bats ."
bats . &> $BATS_LOG
rc=$?
echo "------------------------------"
echo "bats completed with status $rc"
status=PASS
if [ $rc -ne 0 ]; then
status=FAIL
fi
echo "${status} ${TEST_NAME}" >> /tmp/test.log
if [ "$(type -t teardown)" = "function" ]; then
echo "------------------------------"
echo "\$ teardown"
teardown
fi
# FIXME: for CI purposes, always exit 0. This allows subsequent tests.
exit 0

View File

@ -0,0 +1,37 @@
---
# Create empty results file, world-writable
- name: initialize test.log file
copy: dest=/tmp/test.log content='' force=yes mode=0666
- name: execute tests
include: run_one_test.yml
with_items: "{{ tests }}"
loop_control:
loop_var: test
- name: pull test.log results
fetch:
src: "/tmp/test.log"
dest: "{{ artifacts }}/test.log"
flat: yes
# Copied from standard-test-basic
- name: check results
shell: grep "^FAIL" /tmp/test.log
register: test_fails
# Never fail at this step. Just store result of tests.
failed_when: False
- name: preserve results
set_fact:
role_result_failed: "{{ (test_fails.stdout|d|length > 0) or (test_fails.stderr|d|length > 0) }}"
role_result_msg: "{{ test_fails.stdout|d('tests failed.') }}"
- name: display results
vars:
msg: |
Tests failed: {{ role_result_failed|d('Undefined') }}
Tests msg: {{ role_result_msg|d('None') }}
debug:
msg: "{{ msg.split('\n') }}"
failed_when: "role_result_failed|bool"

View File

@ -0,0 +1,52 @@
---
- name: "{{ test.name }} | install test packages"
dnf: name="{{ test.package }}-tests" state=installed
- name: "{{ test.name }} | define helper variables"
set_fact:
test_name_oneword: "{{ test.name | replace(' ','-') }}"
# UGH. This is necessary because our caller sets some environment variables
# and we need to set a few more based on other caller variables; then we
# need to combine the two dicts when running the test. This seems to be
# the only way to do it in ansible.
- name: "{{ test.name }} | define local environment"
set_fact:
local_environment:
TEST_NAME: "{{ test.name }}"
TEST_PACKAGE: "{{ test.package }}"
TEST_ENV: "{{ test.environment }}"
- name: "{{ test.name }} | setup/teardown helper | see if exists"
local_action: stat path={{ role_path }}/files/helper.{{ test_name_oneword }}.sh
register: helper
- name: "{{ test.name }} | setup/teardown helper | install"
copy: src=helper.{{ test_name_oneword }}.sh dest=/tmp/helper.sh
when: helper.stat.exists
- name: "{{ test.name }} | run test"
script: ./run_bats_tests.sh
args:
chdir: /usr/share/{{ test.package }}/test/system
become: "{{ true if test.become is defined else false }}"
become_user: testuser
environment: "{{ local_environment | combine(test.environment) }}"
- name: "{{ test.name }} | pull logs"
fetch:
src: "/tmp/test.{{ item }}.log"
dest: "{{ artifacts }}/test.{{ test_name_oneword }}.{{ item }}.log"
flat: yes
with_items:
- bats
- debug
- name: "{{ test.name }} | remove remote logs and helpers"
file:
dest=/tmp/{{ item }}
state=absent
with_items:
- test.bats.log
- test.debug.log
- helper.sh

2
tests/smoke.fmf Normal file
View File

@ -0,0 +1,2 @@
summary: Execute a simple command
test: podman run -t --rm fedora cat /etc/os-release | grep 'Fedora Linux'

28
tests/tests.yml Normal file
View File

@ -0,0 +1,28 @@
---
- hosts: localhost
tags: classic
vars:
- artifacts: ./artifacts
roles:
- role: bats_installed
- role: rootless_user
- role: run_bats_tests
tests:
- name: podman root
package: podman
environment:
PODMAN: /usr/bin/podman
QUADLET: /usr/libexec/podman/quadlet
- name: podman rootless
package: podman
environment:
PODMAN: /usr/bin/podman
QUADLET: /usr/libexec/podman/quadlet
become: true
#- name: podman-remote root
#package: podman
#environment:
# PODMAN: /usr/bin/podman-remote
# QUADLET: /usr/libexec/podman/quadlet

8
tests/tmt.fmf Normal file
View File

@ -0,0 +1,8 @@
summary: Make sure that container provision works
require:
- tmt-provision-container
test:
tmt run --verbose --remove
provision --how container --image fedora
login --command 'cat /etc/os-release'
finish