First draft of debugging-tools module

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
This commit is contained in:
Petr "Stone" Hracek 2017-04-05 10:29:13 +02:00
commit 0f42648b76
5 changed files with 172 additions and 0 deletions

3
Makefile Normal file
View file

@ -0,0 +1,3 @@
test:
cd tests; make all

58
debugging-tools.yaml Normal file
View file

@ -0,0 +1,58 @@
document: modulemd
version: 1
data:
summary: Set of debugging tools so I can troubleshoot my running server
description: The list of minimal set of debugging tools except base-runtime.
license:
module: [ MIT ]
dependencies:
buildrequires:
base-runtime: master
requires:
base-runtime: master
references:
community: https://fedoraproject.org/wiki/Modularity
documentation: https://fedoraproject.org/wiki/Fedora_Packaging_Guidelines_for_Modules
tracker: https://taiga.fedorainfracloud.org/project/modularity
profiles:
default:
rpms:
- iputils
- iproute
- lsof
- net-tools
- passwd
- strace
- valgrind
api:
rpms:
- iputils
- iproute
- lsof
- net-tools
- passwd
- strace
- valgrind
components:
rpms:
iputils:
rationale: A dependency of tangerine.
ref: master
iproute:
rationale: A dependency of tangerine.
ref: master
lsof:
rationale: A dependency of tangerine.
ref: master
net-tools:
rationale: A dependency of tangerine.
ref: master
passwd:
rationale: A dependency of tangerine.
ref: master
strace:
rationale: A dependency of tangerine.
ref: master
valgrind:
rationale: A dependency of tangerine.
ref: master

14
tests/Makefile Normal file
View file

@ -0,0 +1,14 @@
MODULE_LINT=/usr/lib/python2.7/site-packages/moduleframework/modulelint.py
CMD=python -m avocado run --filter-by-tags=-WIP $(MODULE_LINT) *.py
#
generate:
generator
check-docker:
MODULE=docker $(CMD)
check-rpm:
MODULE=rpm $(CMD)
all: generate check-docker check-rpm

41
tests/config.yaml Normal file
View file

@ -0,0 +1,41 @@
document: modularity-testing
version: 1
name: debugging-tools
modulemd-url: https://raw.githubusercontent.com/container-images/debugging-tools/master/debugging-tools.yaml
packages:
rpms:
- iputils
- iproute
- lsof
- net-tools
- passwd
- strace
- valgrind
source: https://github.com/container-images/debugging-tools
module:
rpm:
repos:
- http://mirror.vutbr.cz/fedora/releases/25/Everything/x86_64/os/
- https://phracek.fedorapeople.org/debugging-tools-repo/
test:
processrunning:
# Tests for iputils
- 'ls /usr/bin/ping'
- 'ls /usr/bin/tracepath'
# Tests for iproute
- 'ls /usr/sbin/ip'
- 'ls /usr/sbin/nstat'
# Tests for lsof
- 'ls /usr/bin/lsof'
# Tests for net-tools
- 'ls /usr/bin/netstat'
- 'ls /usr/sbin/arp'
- 'ls /usr/sbin/ifconfig'
- 'ls /usr/sbin/route'
# Tests for passwd
- 'ls /usr/bin/passwd'
# Tests for strace
- 'ls /usr/bin/strace'
# Tests for valgrind
- 'ls /usr/bin/valgrind'
- 'ls /usr/bin/vgdb'

56
tests/simpleTest.py Normal file
View file

@ -0,0 +1,56 @@
#!/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: Petr Sklenar <psklenar@redhat.com>
#
from moduleframework import module_framework
import os
import time
class simpleTests(module_framework.AvocadoTest):
"""
:avocado: enable
"""
def testAssertIn(self):
self.start()
# Tests for iputils
self.assertIn('Ping exists!', self.runHost('ls /usr/bin/ping').stdout)
self.assertIn('tracepath exists!', self.runHost('ls /usr/bin/tracepath').stdout)
# Tests for iproute
self.assertIn('IP exists!', self.runHost('ls /usr/sbin/ip').stdout)
self.assertIn('Nstat exists!', self.runHost('ls /usr/sbin/nstat').stdout)
# Tests for lsof
self.assertIn('lsof exists!', self.runHost('ls /usr/bin/lsof').stdout)
# Tests for net-tools
self.assertIn('netstat exists!', self.runHost('ls /usr/bin/netstat').stdout)
self.assertIn('arp exists!', self.runHost('ls /usr/sbin/arp').stdout)
self.assertIn('ifconfig exists!', self.runHost('ls /usr/sbin/ifconfig').stdout)
self.assertIn('route exists!', self.runHost('ls /usr/sbin/route').stdout)
# Tests for passwd
self.assertIn('passwd exists!', self.runHost('ls /usr/bin/passwd').stdout)
# Tests for strace
self.assertIn('strace exists!', self.runHost('ls /usr/bin/strace').stdout)
# Tests for valgrind
self.assertIn('valgrind exists!', self.runHost('ls /usr/bin/valgrind').stdout)
self.assertIn('vgdb exists!', self.runHost('ls /usr/bin/vgdb').stdout)