Changeset 333


Ignore:
Timestamp:
Apr 21, 2011, 1:13:43 PM (14 years ago)
Author:
katerina
Message:

Add unit tests for IgnoreAdded/IgnoreDeleted configuration directives

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r328 r333  
    112.8.4:
     2        * Add unit tests for IgnoreAdded/IgnoreDeleted configuration directives
     3        * Fix deadlock after reload when compiled with --enable-login-watch
     4          (reported by M. Teege and O. Cobanoglu)
     5        * Fix compile error for samhain_hide.ko with recent kernel
     6        * Include patch by J. Graumann to specify the location of the
     7          secret keyring with samhainadmin.pl
    28        * Fix potential timeout problem in sh_sub_stat_int() and propagate the
    39          error (issue reported by mtg)
     
    713          check
    814
    9 2.8.3a:
     152.8.3a (23-03-2011):
    1016        * Fix two 'label at end of compound statement' errors on FreeBSD
    1117          (reported by David E. Thiel)
    1218
    13 2.8.3:
     192.8.3 (22-03-2011):
    1420        * init scripts: load samhain_kmem.ko before samhain starts
    1521        * slib.c: eliminate mutex from sl_create_ticket()
     
    3036        * fix Windows/Cygwin compile error (reported by A. Schmidt)
    3137
    32 2.8.2:
     382.8.2 (16-02-2011):
    3339        * add function to skip checksumming
    3440        * Fix missing check for recursion depth >= 0 if not IgnoreAll
     
    3743        * Fix minor bug in check_samhain.pl (pointed out by J.-S. Eon long ago)
    3844
    39 2.8.1:
     452.8.1 (17-11-2010):
    4046        * Document handling of missing files with secondary schedule
    4147        * Fix incorrect handling of missing files when secondary schedule
  • trunk/src/sh_ignore.c

    r170 r333  
    3939#define FIL__ _("sh_ignore.c")
    4040
     41#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
     42
    4143struct sh_ignore_list {
    4244#ifdef HAVE_REGEX_H
     
    191193  return 0;
    192194}
    193 
    194 
    195 
    196 
    197 
    198 
     195#endif
     196
     197#ifdef SH_CUTEST
     198#include "CuTest.h"
     199
     200void Test_ignore_ok (CuTest *tc) {
     201#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
     202
     203  int ret;
     204
     205  CuAssertTrue(tc, NULL == sh_del_ign);
     206  CuAssertTrue(tc, NULL == sh_new_ign);
     207 
     208  ret = sh_ignore_add_del ("/var/log/foo/.*");
     209  CuAssertTrue(tc, 0 == ret);
     210  CuAssertPtrNotNull(tc, sh_del_ign);
     211
     212  ret = sh_ignore_chk_del ("/var/log/foo/test");
     213  CuAssertTrue(tc, S_TRUE == ret);
     214  CuAssertTrue(tc, NULL == sh_new_ign);
     215 
     216  ret = sh_ignore_chk_del ("/var/log/footest");
     217  CuAssertTrue(tc, S_FALSE == ret);
     218
     219  ret = sh_ignore_chk_del ("/my/var/log/footest");
     220  CuAssertTrue(tc, S_FALSE == ret);
     221
     222  sh_ignore_clean();
     223  CuAssertTrue(tc, NULL == sh_del_ign);
     224  CuAssertTrue(tc, NULL == sh_new_ign);
     225 
     226  ret = sh_ignore_add_new ("/var/log/foo/.*");
     227  CuAssertTrue(tc, 0 == ret);
     228  CuAssertPtrNotNull(tc, sh_new_ign);
     229  CuAssertTrue(tc, NULL == sh_del_ign);
     230
     231  ret = sh_ignore_chk_new ("/var/log/foo/test");
     232  CuAssertTrue(tc, S_TRUE == ret);
     233 
     234  ret = sh_ignore_chk_new ("/var/log/footest");
     235  CuAssertTrue(tc, S_FALSE == ret);
     236
     237  ret = sh_ignore_chk_new ("/my/var/log/footest");
     238  CuAssertTrue(tc, S_FALSE == ret);
     239
     240  sh_ignore_clean();
     241  CuAssertTrue(tc, NULL == sh_new_ign);
     242  CuAssertTrue(tc, NULL == sh_del_ign);
     243
     244#else
     245  (void) tc; /* fix compiler warning */
     246#endif
     247  return;
     248}
     249/* #ifdef SH_CUTEST */
     250#endif
     251
Note: See TracChangeset for help on using the changeset viewer.