Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01b23788ea | ||
|
|
3cfc8f397b | ||
|
|
683691c4e7 | ||
|
|
0794f3c68e | ||
|
|
f179156b70 | ||
|
|
81e5f7b137 | ||
|
|
810faf7da8 | ||
|
|
04de990720 | ||
|
|
f8c3b4db33 | ||
|
|
eb79cb598b | ||
|
|
04d4d21ae4 | ||
|
|
d3d9b86c80 | ||
|
|
dcda12f964 | ||
|
|
42838389f9 | ||
|
|
ad5363812a | ||
|
|
8176e05bde | ||
|
|
0bcc6f3218 | ||
|
|
e7eb65a0e1 |
8 changed files with 228 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -0,0 +1 @@
|
||||||
|
*.idea*
|
||||||
8
Dockerfile
Normal file
8
Dockerfile
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
FROM baseruntime/baseruntime:latest
|
||||||
|
|
||||||
|
LABEL MAINTAINER Rado Pitonak <rpitonak@redhat.com>
|
||||||
|
|
||||||
|
RUN microdnf --nodocs install php && \
|
||||||
|
microdnf -y clean all
|
||||||
|
|
||||||
|
CMD bash
|
||||||
17
Makefile
Normal file
17
Makefile
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
IMAGE_NAME = php
|
||||||
|
|
||||||
|
MODULEMDURL=file://php.yaml
|
||||||
|
|
||||||
|
default: run
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build --tag=$(IMAGE_NAME) .
|
||||||
|
|
||||||
|
run: build
|
||||||
|
docker run -d $(IMAGE_NAME)
|
||||||
|
|
||||||
|
debug: build
|
||||||
|
docker run -it $(IMAGE_NAME) bash
|
||||||
|
|
||||||
|
test: build
|
||||||
|
cd tests; MODULE=docker MODULEMD=$(MODULEMDURL) URL="docker=$(IMAGE_NAME)" make all
|
||||||
23
README.md
Normal file
23
README.md
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# php module
|
||||||
|
|
||||||
|
[**Package DB** (owner)](https://admin.fedoraproject.org/pkgdb/package/modules/php/) |
|
||||||
|
[**F26 modulemd** (source)](http://pkgs.fedoraproject.org/cgit/modules/php.git/tree/php.yaml?h=f26) |
|
||||||
|
[**PDC** (result)](https://pdc.fedoraproject.org/rest_api/v1/unreleasedvariants/?active=True&variant_name=php)
|
||||||
|
|
||||||
|
|
||||||
|
PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
|
||||||
|
|
||||||
|
## Current state
|
||||||
|
|
||||||
|
| State | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| ✓ YES | **Build passes** in the infra (all build deps are ok) |
|
||||||
|
| ✓ YES | **Installs** on the Base Runtime (all runtime deps are ok) |
|
||||||
|
| ✗ NO | **No bootstrap** - uses only proper modules |
|
||||||
|
| ✓ YES | General **tests are in dist-git** |
|
||||||
|
| ✓ YES | General **tests pass** |
|
||||||
|
| ✗ NO | Meets the **Fedora Module Packaging Guidelines** |
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
See [**PHP s2i image**](https://github.com/container-images/php) on github for more details.
|
||||||
97
php.yaml
Normal file
97
php.yaml
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
document: modulemd
|
||||||
|
version: 1
|
||||||
|
data:
|
||||||
|
summary: PHP scripting language for creating dynamic web sites
|
||||||
|
description: PHP is an HTML-embedded scripting language. PHP attempts to make it
|
||||||
|
easy for developers to write dynamically generated web pages. PHP also
|
||||||
|
offers built-in database integration for several commercial and
|
||||||
|
non-commercial database management systems, so writing a
|
||||||
|
database-enabled webpage with PHP is fairly simple. The most common
|
||||||
|
use of PHP coding is probably as a replacement for CGI scripts.
|
||||||
|
The php package contains the module (often referred to as mod_php)
|
||||||
|
which adds support for the PHP language to Apache HTTP Server.
|
||||||
|
license:
|
||||||
|
module: [PHP and Zend and BSD]
|
||||||
|
dependencies:
|
||||||
|
buildrequires:
|
||||||
|
# base-runtime: f26
|
||||||
|
bootstrap: f26
|
||||||
|
common-build-dependencies: f26
|
||||||
|
# shared-userspace: f26
|
||||||
|
perl: f26
|
||||||
|
postgresql: f26
|
||||||
|
nginx: f26
|
||||||
|
httpd: f26
|
||||||
|
requires:
|
||||||
|
perl: f26
|
||||||
|
shared-userspace: f26
|
||||||
|
base-runtime: f26
|
||||||
|
httpd: f26
|
||||||
|
references:
|
||||||
|
community: https://docs.pagure.org/modularity/
|
||||||
|
documentation: https://github.com/modularity-modules/php
|
||||||
|
tracker: https://github.com/modularity-modules/php
|
||||||
|
profiles:
|
||||||
|
default:
|
||||||
|
rpms:
|
||||||
|
- php
|
||||||
|
api:
|
||||||
|
rpms:
|
||||||
|
- php
|
||||||
|
filter:
|
||||||
|
rpms:
|
||||||
|
- php-dba
|
||||||
|
- php-devel
|
||||||
|
- php-enchant
|
||||||
|
- php-gd
|
||||||
|
- php-imap
|
||||||
|
- php-interbase
|
||||||
|
- php-mcrypt
|
||||||
|
- php-odbc
|
||||||
|
- php-pdo-dblib
|
||||||
|
- php-pspell
|
||||||
|
- php-recode
|
||||||
|
- php-snmp
|
||||||
|
- php-tidy
|
||||||
|
components:
|
||||||
|
rpms:
|
||||||
|
php:
|
||||||
|
rationale: php package.
|
||||||
|
ref: f26
|
||||||
|
buildorder: 10
|
||||||
|
# nginx:
|
||||||
|
# rationale: Provides API for this module.
|
||||||
|
# ref: f26
|
||||||
|
# buildorder: 2
|
||||||
|
# gperftools:
|
||||||
|
# rationale: dependency
|
||||||
|
# ref: f26
|
||||||
|
# buildorder: 1
|
||||||
|
# libmnl:
|
||||||
|
# rationale: dependency
|
||||||
|
# ref: f26
|
||||||
|
# buildorder: 1
|
||||||
|
# libnetfilter_conntrack:
|
||||||
|
# rationale: dependency
|
||||||
|
# ref: f26
|
||||||
|
# buildorder: 1
|
||||||
|
# libnfnetlink:
|
||||||
|
# rationale: dependency
|
||||||
|
# ref: f26
|
||||||
|
# buildorder: 1
|
||||||
|
# libunwind:
|
||||||
|
# rationale: dependency
|
||||||
|
# ref: f26
|
||||||
|
# buildorder: 1
|
||||||
|
libxkbcommon:
|
||||||
|
rationale: dependency
|
||||||
|
ref: f26
|
||||||
|
buildorder: 1
|
||||||
|
mailcap:
|
||||||
|
rationale: dependency
|
||||||
|
ref: f26
|
||||||
|
buildorder: 1
|
||||||
|
xkeyboard-config:
|
||||||
|
rationale: dependency
|
||||||
|
ref: f26
|
||||||
|
buildorder: 1
|
||||||
6
tests/Makefile
Normal file
6
tests/Makefile
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
MODULE_LINT=/usr/share/moduleframework/tools/modulelint.py
|
||||||
|
CMD=python -m avocado run --filter-by-tags=-WIP $(MODULE_LINT) *.py
|
||||||
|
|
||||||
|
#
|
||||||
|
all:
|
||||||
|
$(CMD)
|
||||||
16
tests/config.yaml
Normal file
16
tests/config.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
document: modularity-testing
|
||||||
|
version: 1
|
||||||
|
name: php
|
||||||
|
modulemd-url: http://pkgs.fedoraproject.org/cgit/modules/php.git/plain/php.yaml?h=f26
|
||||||
|
service:
|
||||||
|
port: 8080
|
||||||
|
packages:
|
||||||
|
rpms:
|
||||||
|
- php
|
||||||
|
module:
|
||||||
|
docker:
|
||||||
|
start: "docker run -it"
|
||||||
|
container: php
|
||||||
|
rpm:
|
||||||
|
repos:
|
||||||
|
- http://mirror.vutbr.cz/fedora/releases/26/Everything/x86_64/os/
|
||||||
60
tests/sanity1.py
Normal file
60
tests/sanity1.py
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# This Modularity Testing Framework helps you to write tests for modules
|
||||||
|
# Copyright (C) 2017 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# he Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
#
|
||||||
|
# Authors: Rado Pitonak <rpitonak@redhat.com>
|
||||||
|
#
|
||||||
|
|
||||||
|
from avocado import main
|
||||||
|
from avocado.core import exceptions
|
||||||
|
from moduleframework import module_framework
|
||||||
|
|
||||||
|
|
||||||
|
class SanityCheck(module_framework.AvocadoTest):
|
||||||
|
"""
|
||||||
|
:avocado: enable
|
||||||
|
"""
|
||||||
|
|
||||||
|
def testPhpBinary(self):
|
||||||
|
"""
|
||||||
|
Simple sanity test
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.start()
|
||||||
|
self.run("ls /bin | grep php")
|
||||||
|
|
||||||
|
def test2PHPVersion(self):
|
||||||
|
"""
|
||||||
|
Check if PHP is installed in correct version
|
||||||
|
"""
|
||||||
|
version = "7."
|
||||||
|
self.start()
|
||||||
|
self.run("php -v | grep {}".format(version))
|
||||||
|
|
||||||
|
def testScriptExecution(self):
|
||||||
|
"""
|
||||||
|
Execute simple PHP script from CLI
|
||||||
|
"""
|
||||||
|
output = "Hello world!"
|
||||||
|
self.start()
|
||||||
|
self.assertIn(output, self.run("php -r 'echo \"{}\";'".format(output)).stdout)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue