[prev in list] [next in list] [prev in thread] [next in thread] 

List:       proftpd-committers
Subject:    [ProFTPD-committers] proftpd/tests/t/lib/ProFTPD/Tests/Commands
From:       TJ Saunders <castaglia () users ! sourceforge ! net>
Date:       2011-09-24 5:05:30
Message-ID: E1R7KQe-0003C4-7b () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/proftp/proftpd/tests/t/lib/ProFTPD/Tests/Commands
In directory vz-cvs-3.sog:/tmp/cvs-serv13458/t/lib/ProFTPD/Tests/Commands

Modified Files:
	FEAT.pm 
Log Message:

Update the FEAT unit test to better handle when other modules, e.g.
mod_site_misc and mod_copy, are in the build.


Index: FEAT.pm
===================================================================
RCS file: /cvsroot/proftp/proftpd/tests/t/lib/ProFTPD/Tests/Commands/FEAT.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- FEAT.pm	18 Oct 2010 17:43:48 -0000	1.7
+++ FEAT.pm	24 Sep 2011 05:05:27 -0000	1.8
@@ -80,7 +80,26 @@
     },
   };
 
+  # By default, we expect to see 9 lines in the FEAT response
+  my $expected_nfeat = 9;
+
   my $have_nls = feature_have_feature_enabled('nls');
+  if ($have_nls) {
+    $expected_nfeat += 2;
+  }
+
+  my $have_site_misc = feature_have_module_compiled('mod_site_misc.c');
+  if ($have_site_misc) {
+    # For the following SITE commands added by mod_site_misc: MKDIR,
+    #  RMDIR, UTIME, and SYMLINK.
+    $expected_nfeat += 4;
+  }
+
+  my $have_copy = feature_have_module_compiled('mod_copy.c');
+  if ($have_copy) {
+    # For the following SITE commands added by mod_copy: COPY.
+    $expected_nfeat += 1;
+  }
 
   my ($port, $config_user, $config_group) = config_write($config_file, $config);
 
@@ -111,14 +130,9 @@
       $self->assert($expected == $resp_code,
         test_msg("Expected $expected, got $resp_code"));
 
-      $expected = 9;
-      if ($have_nls) {
-        $expected += 2;
-      }
-
       my $nfeat = scalar(@$resp_msgs);
-      $self->assert($expected == $nfeat,
-        test_msg("Expected $expected, got $nfeat"));
+      $self->assert($expected_nfeat == $nfeat,
+        test_msg("Expected $expected_nfeat features, got $nfeat"));
 
       my $feats = { 
         'Features:' => 1,
@@ -145,6 +159,17 @@
         $feats->{' LANG en-US.UTF-8*'} = 1;
       }
 
+      if ($have_site_misc) {
+        $feats->{' SITE MKDIR'} = 1;
+        $feats->{' SITE RMDIR'} = 1;
+        $feats->{' SITE SYMLINK'} = 1;
+        $feats->{' SITE UTIME'} = 1;
+      }
+
+      if ($have_copy) {
+        $feats->{' SITE COPY'} = 1;
+      }
+
       for (my $i = 0; $i < $nfeat; $i++) {
         $self->assert(defined($feats->{$resp_msgs->[$i]}), ,
           test_msg("Unexpected FEAT '$resp_msgs->[$i]'"));


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
ProFTPD Committers Mailing List
proftpd-committers@proftpd.org
https://lists.sourceforge.net/lists/listinfo/proftp-committers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic