Bug 1004756 - Not all tests call 'cleanup' in the end, causing difficulties with single test runs
Not all tests call 'cleanup' in the end, causing difficulties with single tes...
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: tests (Show other bugs)
3.4.0
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Kaleb KEITHLEY
: Patch
Depends On: 983975
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-05 08:12 EDT by Kaleb KEITHLEY
Modified: 2015-12-01 11:45 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 983975
Environment:
Last Closed: 2013-10-07 08:25:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kaleb KEITHLEY 2013-09-05 08:12:30 EDT
+++ This bug was initially created as a clone of Bug #983975 +++

Description of problem:

I run the following script to verify the correct unloading of the 'fuse'
module for some testing. During these tests, I have noticed that not all
test-scripts call 'cleanup' in the end. This causes the unloading of the
'fuse' module to fail as there is (often) still a glusterfs mountpoint active.

        for BUG in $PWD/tests/bugs/*
        do
                BNAME=$(basename $BUG)
                # skip non directories or non .t files
                if [ -d $BUG -o "$BNAME" != "$(basename $BNAME .t)" ]
                then
                        true
                else
                        echo "Skipping $BNAME"
                        continue
                fi

                insmod fuse.ko

                logger -s -t prove -- "starting test(s) for $BNAME"
                sleep 1 ; sync
                prove -rf --timer $BUG
                sleep 5
                dmesg -c > $BNAME.dmesg
                lsmod | grep fuse > $BNAME.lsmod

                if ( lsmod | grep -q fuse ) && ! rmmod fuse
                then
                        echo "Failed to rmmod fuse" >/dev/stderr
                        exit 1
                fi
        done

Version-Release number of selected component (if applicable):
current master branch

How reproducible:
100%

Steps to Reproduce:
1. run the above script
2. wait til it fails
3. check for mountpoints

Actual results:
Each test should cleanup after itself.

Expected results:
The above script runs all tests.

--- Additional comment from Anand Avati on 2013-07-12 09:04:02 EDT ---

REVIEW: http://review.gluster.org/5328 (tests: call 'cleanup' at the end of each test) posted (#1) for review on master by Niels de Vos (ndevos@redhat.com)

--- Additional comment from Anand Avati on 2013-07-15 13:45:08 EDT ---

COMMIT: http://review.gluster.org/5328 committed in master by Anand Avati (avati@redhat.com) 
------
commit c50aa14008f9612d273acb81470f544cad6cff1a
Author: Niels de Vos <ndevos@redhat.com>
Date:   Fri Jul 12 15:00:07 2013 +0200

    tests: call 'cleanup' at the end of each test
    
    Some tests do not cleanup after themselves. That is bad behaviour and
    makes it difficult to run single tests and verify the state of the
    system afterwards.
    
    Change-Id: I4ac5401d790d6bc81e6975fd1384874b21d6cf8a
    BUG: 983975
    Signed-off-by: Niels de Vos <ndevos@redhat.com>
    Reviewed-on: http://review.gluster.org/5328
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
    Reviewed-by: Anand Avati <avati@redhat.com>
Comment 1 Anand Avati 2013-09-05 08:59:21 EDT
REVIEW: http://review.gluster.org/5821 (tests: call 'cleanup' at the end of each test (backport BZ 983975)) posted (#1) for review on release-3.4 by Kaleb KEITHLEY (kkeithle@redhat.com)
Comment 2 Anand Avati 2013-09-09 20:27:40 EDT
COMMIT: http://review.gluster.org/5821 committed in release-3.4 by Anand Avati (avati@redhat.com) 
------
commit 71f8726b0a94ee830454369f7da2b508d8975d30
Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Date:   Thu Sep 5 08:56:25 2013 -0400

    tests: call 'cleanup' at the end of each test (backport BZ 983975)
    
    Some tests do not cleanup after themselves. That is bad behaviour and
    makes it difficult to run single tests and verify the state of the
    system afterwards.
    
    Change-Id: I5cf80a4a996c691e6b82fd9ce9c711951dc26138
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
    BUG: 1004756
    Reviewed-on: http://review.gluster.org/5821
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Niels de Vos <ndevos@redhat.com>

Note You need to log in before you can comment on or make changes to this bug.