Bug 983975 - Not all tests call 'cleanup' in the end, causing difficulties with single test runs
Summary: Not all tests call 'cleanup' in the end, causing difficulties with single tes...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: tests
Version: mainline
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1004756
TreeView+ depends on / blocked
 
Reported: 2013-07-12 12:29 UTC by Niels de Vos
Modified: 2013-09-05 12:12 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1004756 (view as bug list)
Environment:
Last Closed: 2013-07-24 17:24:23 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Niels de Vos 2013-07-12 12:29:46 UTC
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.

Comment 1 Anand Avati 2013-07-12 13:04:02 UTC
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)

Comment 2 Anand Avati 2013-07-15 17:45:08 UTC
COMMIT: http://review.gluster.org/5328 committed in master by Anand Avati (avati) 
------
commit c50aa14008f9612d273acb81470f544cad6cff1a
Author: Niels de Vos <ndevos>
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>
    Reviewed-on: http://review.gluster.org/5328
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Kaleb KEITHLEY <kkeithle>
    Reviewed-by: Anand Avati <avati>


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