"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/lastseen_test.c" between
cfengine-3.15.3.tar.gz and cfengine-3.15.4.tar.gz

About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.

lastseen_test.c  (cfengine-3.15.3):lastseen_test.c  (cfengine-3.15.4)
skipping to change at line 178 skipping to change at line 178
} }
static void test_remove(void) static void test_remove(void)
{ {
setup(); setup();
UpdateLastSawHost("SHA-12345", "127.0.0.64", true, 555); UpdateLastSawHost("SHA-12345", "127.0.0.64", true, 555);
UpdateLastSawHost("SHA-12345", "127.0.0.64", false, 556); UpdateLastSawHost("SHA-12345", "127.0.0.64", false, 556);
//RemoveHostFromLastSeen("SHA-12345"); //RemoveHostFromLastSeen("SHA-12345");
DeleteDigestFromLastSeen("SHA-12345", NULL, 0); DeleteDigestFromLastSeen("SHA-12345", NULL, 0, true);
DBHandle *db; DBHandle *db;
OpenDB(&db, dbid_lastseen); OpenDB(&db, dbid_lastseen);
assert_int_equal(HasKeyDB(db, "qiSHA-12345", strlen("qiSHA-12345") + 1), fal se); assert_int_equal(HasKeyDB(db, "qiSHA-12345", strlen("qiSHA-12345") + 1), fal se);
assert_int_equal(HasKeyDB(db, "qoSHA-12345", strlen("qoSHA-12345") + 1), fal se); assert_int_equal(HasKeyDB(db, "qoSHA-12345", strlen("qoSHA-12345") + 1), fal se);
assert_int_equal(HasKeyDB(db, "kSHA-12345", strlen("kSHA-12345") + 1), false ); assert_int_equal(HasKeyDB(db, "kSHA-12345", strlen("kSHA-12345") + 1), false );
assert_int_equal(HasKeyDB(db, "a127.0.0.64", strlen("a127.0.0.64") + 1), fal se); assert_int_equal(HasKeyDB(db, "a127.0.0.64", strlen("a127.0.0.64") + 1), fal se);
CloseDB(db); CloseDB(db);
} }
static void test_remove_no_a_entry(void)
{
setup();
UpdateLastSawHost("SHA-12345", "127.0.0.64", true, 555);
UpdateLastSawHost("SHA-12345", "127.0.0.64", false, 556);
DBHandle *db;
OpenDB(&db, dbid_lastseen);
assert_true(DeleteDB(db, "a127.0.0.64"));
assert_false(DeleteDigestFromLastSeen("SHA-12345", NULL, 0, true));
assert_true(DeleteDigestFromLastSeen("SHA-12345", NULL, 0, false));
assert_false(HasKeyDB(db, "qiSHA-12345", strlen("qiSHA-12345") + 1));
assert_false(HasKeyDB(db, "qoSHA-12345", strlen("qoSHA-12345") + 1));
assert_false(HasKeyDB(db, "kSHA-12345", strlen("kSHA-12345") + 1));
assert_false(HasKeyDB(db, "a127.0.0.64", strlen("a127.0.0.64") + 1));
CloseDB(db);
}
static void test_remove_ip(void) static void test_remove_ip(void)
{ {
setup(); setup();
UpdateLastSawHost("SHA-12345", "127.0.0.64", true, 555); UpdateLastSawHost("SHA-12345", "127.0.0.64", true, 555);
UpdateLastSawHost("SHA-12345", "127.0.0.64", false, 556); UpdateLastSawHost("SHA-12345", "127.0.0.64", false, 556);
char digest[CF_BUFSIZE]; char digest[CF_BUFSIZE];
DeleteIpFromLastSeen("127.0.0.64", digest, sizeof(digest)); DeleteIpFromLastSeen("127.0.0.64", digest, sizeof(digest));
skipping to change at line 580 skipping to change at line 602
tests_setup(); tests_setup();
const UnitTest tests[] = const UnitTest tests[] =
{ {
unit_test(test_newentry), unit_test(test_newentry),
unit_test(test_update), unit_test(test_update),
unit_test(test_reverse_missing), unit_test(test_reverse_missing),
unit_test(test_reverse_conflict), unit_test(test_reverse_conflict),
unit_test(test_reverse_missing_forward), unit_test(test_reverse_missing_forward),
unit_test(test_remove), unit_test(test_remove),
unit_test(test_remove_no_a_entry),
unit_test(test_remove_ip), unit_test(test_remove_ip),
unit_test_setup_teardown(test_consistent_1a, begin, end), unit_test_setup_teardown(test_consistent_1a, begin, end),
unit_test_setup_teardown(test_consistent_1b, begin, end), unit_test_setup_teardown(test_consistent_1b, begin, end),
unit_test_setup_teardown(test_consistent_2a, begin, end), unit_test_setup_teardown(test_consistent_2a, begin, end),
unit_test_setup_teardown(test_consistent_2b, begin, end), unit_test_setup_teardown(test_consistent_2b, begin, end),
unit_test_setup_teardown(test_consistent_3a, begin, end), unit_test_setup_teardown(test_consistent_3a, begin, end),
unit_test_setup_teardown(test_consistent_3b, begin, end), unit_test_setup_teardown(test_consistent_3b, begin, end),
unit_test_setup_teardown(test_consistent_4a, begin, end), unit_test_setup_teardown(test_consistent_4a, begin, end),
unit_test_setup_teardown(test_consistent_4b, begin, end), unit_test_setup_teardown(test_consistent_4b, begin, end),
 End of changes. 3 change blocks. 
1 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)