Blame tests/simpleTest.py

0f42648
#!/usr/bin/python
0f42648
# -*- coding: utf-8 -*-
0f42648
#
0f42648
# This Modularity Testing Framework helps you to write tests for modules
0f42648
# Copyright (C) 2017 Red Hat, Inc.
0f42648
#
0f42648
# This program is free software; you can redistribute it and/or modify
0f42648
# it under the terms of the GNU General Public License as published by
0f42648
# he Free Software Foundation; either version 2 of the License, or
0f42648
# (at your option) any later version.
0f42648
#
0f42648
# This program is distributed in the hope that it will be useful,
0f42648
# but WITHOUT ANY WARRANTY; without even the implied warranty of
0f42648
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0f42648
# GNU General Public License for more details.
0f42648
#
0f42648
# You should have received a copy of the GNU General Public License along
0f42648
# with this program; if not, write to the Free Software Foundation, Inc.,
0f42648
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0f42648
#
0f42648
# Authors: Petr Sklenar <psklenar@redhat.com>
0f42648
#
0f42648
0f42648
from moduleframework import module_framework
0f42648
import os
0f42648
import time
0f42648
0f42648
0f42648
class simpleTests(module_framework.AvocadoTest):
0f42648
    """
0f42648
    :avocado: enable
0f42648
    """
0f42648
32a28ee
    def test_iputils(self):
0f42648
        self.start()
32a28ee
        self.run('ls -al /usr/bin/ping')
32a28ee
        self.run('ls -al /usr/bin/tracepath')
32a28ee
        self.run('lsof /')
32a28ee
32a28ee
    def test_iproute(self):
32a28ee
        self.start()
32a28ee
        self.run('ls -al /usr/sbin/ip')
32a28ee
        self.run('ls -al /usr/sbin/ifcfg')
32a28ee
        x = self.run('/usr/sbin/ifcfg', ignore_status=True)
32a28ee
        self.assertEqual(1, x.exit_status)
32a28ee
        self.run('ls -al /usr/sbin/ifstat')
32a28ee
        self.run('/usr/sbin/ifstat')
32a28ee
32a28ee
    def test_lsof(self):
32a28ee
        self.run('lsof /')
32a28ee
32a28ee
    def test_net_tools(self):
32a28ee
        self.run('ls -al /usr/sbin/route')
32a28ee
        self.run('route')
32a28ee
        self.run('ls -al /usr/bin/netstat')
32a28ee
        self.run('netstat')
32a28ee
32a28ee
    def test_passwd(self):
32a28ee
        self.run('ls -al /usr/bin/passwd')
32a28ee
        self.run('passwd --help')
32a28ee
32a28ee
    def test_strace(self):
32a28ee
        self.run('ls -al /usr/bin/strace')
32a28ee
        self.run('strace -h')
32a28ee
32a28ee
    def test_valgrind(self):
32a28ee
        self.run('ls -al /usr/bin/valgrind')
32a28ee
        self.run('valgrind -h')
0f42648