[omd-commits] OMD Git: omd: tests: clean cookie file after tests

git version control git at mathias-kettner.de
Mon Sep 8 19:40:04 CEST 2014


Module:   omd
Branch:   master
Commit:   81b2c3e3eae4d51c78f0cd74955554bb9656cefb
URL:      http://omdistro.org/projects/omd/repository/revisions/81b2c3e3eae4d51c78f0cd74955554bb9656cefb

Author:   Sven Nierlein <Sven.Nierlein at consol.de>
Date:     Mon Sep  8 19:39:45 2014 +0200
Commiter: Sven Nierlein <Sven.Nierlein at consol.de>
Date:     Mon Sep  8 19:39:45 2014 +0200

tests: clean cookie file after tests

---

 t/TestUtils.pm |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/TestUtils.pm b/t/TestUtils.pm
index 8e29ed9..0da5f3c 100644
--- a/t/TestUtils.pm
+++ b/t/TestUtils.pm
@@ -637,10 +637,10 @@ sub _request {
     my $data = shift;
 
     my $return = {};
-    our $cookie_jar;
+    our($fh, $cookie_jar, $cookie_file);
 
     if(!defined $cookie_jar) {
-        my($fh, $cookie_file) = tempfile('', UNLINK => 1);
+        ($fh, $cookie_file) = tempfile();
         unlink ($cookie_file);
         $cookie_jar = HTTP::Cookies::Netscape->new(
                                        file     => $cookie_file,
@@ -860,6 +860,8 @@ sub restart_system_apache {
 ##################################################
 
 END {
+    our($cookie_file);
+    unlink($cookie_file);
     if(defined $omd_symlink_created and $omd_symlink_created == 1) {
         unlink('/omd');
     }



More information about the omd-commits mailing list