re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-07-10 16:08:18 +02:00
parent 3615869ee0
commit eb7b338fde
6 changed files with 95 additions and 0 deletions

6
.gitignore vendored
View File

@ -1 +1,7 @@
/bottle-0.9.5.tar.gz
/bottle-0.10.7.tar.gz
/bottle-0.11.6.tar.gz
/bottle-0.11.7.tar.gz
/bottle-0.12.6.tar.gz
/bottle-0.12.9.tar.gz
/bottle-0.12.13.tar.gz

6
gating.yaml Normal file
View File

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

13
tests/build-pycurl/runtest.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# exit immediately if any command returns non-zero exit code
set -e
# print commands as they are executed by the shell interpreter
set -x
# download source RPM of python-pycurl
yum download --source python-pycurl
# rebuild the source RPM (%check uses bottle)
rpmbuild --rebuild ./python-pycurl-*.src.rpm

8
tests/simple-server/hello.py Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/python3
from bottle import route, run, template
@route('/hello/<name>')
def index(name):
return template('<b>Hello {{name}}</b>!', name=name)
run(host='localhost', port=1234)

38
tests/simple-server/runtest.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
# exit immediately if any command returns non-zero exit code
set -e
# print commands as they are executed by the shell interpreter
set -x
# global constants
HOST="localhost"
PORT="1234"
URL="http://${HOST}:${PORT}/hello/rhel"
CURL_OUT="./curl.out"
CURL_ERR="./curl.err"
# print versions of related pkgs
PKGS="$(set +x; eval echo {lib,}curl python3-bottle)"
rpm -q $PKGS | sort -V
rpm -V $PKGS
# run HTTP server in the background
./hello.py &
BOTTLE_PID=$!
# FIXME: wait for open port instead
sleep 2
# check that HTTP server works using curl
curl -fsvo $CURL_OUT $URL
# check whether the received data matches the expected contents
diff <(printf "<b>Hello rhel</b>!") $CURL_OUT
# kill nghttpd running in the background
kill $BOTTLE_PID
# wait till the background process finishes
wait

24
tests/tests.yml Normal file
View File

@ -0,0 +1,24 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- simple-server:
dir: simple-server
run: ./runtest.sh
- build-pycurl:
dir: build-pycurl
run: ./runtest.sh
required_packages:
- curl
- dnf
- gcc
- libcurl-devel
- make
- openssl-devel
- python3-devel
- python3-bottle
- python3-nose
- rpm-build
- vsftpd