From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112441 invoked by alias); 10 Dec 2015 10:43:15 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 112387 invoked by uid 89); 10 Dec 2015 10:43:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: heian.cn.fujitsu.com Received: from cn.fujitsu.com (HELO heian.cn.fujitsu.com) (59.151.112.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Dec 2015 10:43:13 +0000 Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 10 Dec 2015 18:42:52 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id E4FEC40427C8 for ; Thu, 10 Dec 2015 18:42:49 +0800 (CST) Received: from localhost.localdomain (10.167.226.48) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 10 Dec 2015 18:42:49 +0800 From: Zhou Wenjian To: Subject: [PATCH 3/3] Add new case for -k Date: Thu, 10 Dec 2015 10:43:00 -0000 Message-ID: <1449744091-1673-3-git-send-email-zhouwj-fnst@cn.fujitsu.com> In-Reply-To: <1449744091-1673-1-git-send-email-zhouwj-fnst@cn.fujitsu.com> References: <1449744091-1673-1-git-send-email-zhouwj-fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-yoursite-MailScanner-Information: Please contact the ISP for more information X-yoursite-MailScanner-ID: E4FEC40427C8.A6FB4 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: zhouwj-fnst@cn.fujitsu.com X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00256.txt.bz2 * testsuite/systemtap.base/temp-directory.exp: new test case --- testsuite/systemtap.base/temp-directory.exp | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 testsuite/systemtap.base/temp-directory.exp diff --git a/testsuite/systemtap.base/temp-directory.exp b/testsuite/systemtap.base/temp-directory.exp new file mode 100644 index 0000000..66a629f --- /dev/null +++ b/testsuite/systemtap.base/temp-directory.exp @@ -0,0 +1,37 @@ +# Check keep temporary directory +set test "keep temporary directory" +#if {![installtest_p]} { untested "$test"; return } + +# Script we'll use while testing: +set script "probe begin{exit();}" +set ret 0 + +spawn stap -k -e $script +expect { +-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {set dir $expect_out(1,string); exp_continue} +eof +} + +if { [file isdirectory $dir] == 1 } { + exec rm -rf $dir +} else { + set ret 1 +} + +spawn stap -k -p1 -e $script +expect { +-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {set dir $expect_out(1,string); exp_continue} +eof +} + +if { [file isdirectory $dir] == 1 } { + exec rm -rf $dir +} else { + set ret 1 +} + +if { $ret == 0 } { + pass $test +} else { + fail $test +} -- 1.8.3.1