Show
Ignore:
Timestamp:
01/10/07 14:06:43 (2 years ago)
Author:
kindlund
Message:

Merged trunk changes back into exp branch, in order to prepare for final merge back into trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/exp/stephenson-link_scoring

    • Property sc:bug-fix-release-branch set to 0.9
  • honeyclient/branches/exp/stephenson-link_scoring/t/honeyclient_agent_driver.t

    r13 r153  
    1111# Make sure Log::Log4perl loads 
    1212BEGIN { use_ok('Log::Log4perl', qw(:nowarn)) 
    13         or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly linsted within the path."); 
     13        or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly listed within the path."); 
    1414        
    1515        # Suppress all logging messages, since we need clean output for unit testing. 
  • honeyclient/branches/exp/stephenson-link_scoring/t/honeyclient_agent_integrity.t

    r13 r153  
    1717can_ok('HoneyClient::Agent::Integrity', 'initFileSystem'); 
    1818can_ok('HoneyClient::Agent::Integrity', 'checkFileSystem'); 
    19 can_ok('HoneyClient::Agent::Integrity', 'initRegistry'); 
    20 can_ok('HoneyClient::Agent::Integrity', 'checkRegistry'); 
    21 use HoneyClient::Agent::Integrity qw(initAll checkAll initRegistry checkRegistry initFileSystem checkFileSystem); 
     19use HoneyClient::Agent::Integrity qw(initAll checkAll initFileSystem checkFileSystem); 
    2220 
    2321# Make sure HoneyClient::Util::Config loads. 
     
    4644 
    4745# Make sure Storable loads. 
    48 BEGIN { use_ok('Storable', qw(dclone)) or diag("Can't load Storable package.  Check to make sure the package library is correctly listed within the path."); } 
     46BEGIN { use_ok('Storable', qw(dclone nfreeze thaw)) or diag("Can't load Storable package.  Check to make sure the package library is correctly listed within the path."); } 
    4947require_ok('Storable'); 
    5048can_ok('Storable', 'dclone'); 
    51 use Storable qw(dclone); 
     49can_ok('Storable', 'nfreeze'); 
     50can_ok('Storable', 'thaw'); 
     51use Storable qw(dclone nfreeze thaw); 
    5252 
    5353###Testing Globals### 
    5454# Directory where the known-good test files are stored 
    55 $test_dir = getVar(name => "test_dir", namespace => "HoneyClient::Agent::Integrity"); 
     55$test_dir = getVar(name => "test_dir"); 
    5656 
    5757# List of files and directories to check during filesystem checking 
    58 $file_checklist = getVar(name => "file_checklist", namespace => "HoneyClient::Agent::Integrity"); 
     58$file_checklist = getVar(name => "file_checklist"); 
    5959 
    6060# List of files or directories to exclude if found in subdirs during 
    6161# filesystem check. 
    62 $file_exclude = getVar(name => "file_exclude", namespace => "HoneyClient::Agent::Integrity"); 
     62$file_exclude = getVar(name => "file_exclude"); 
    6363 
    6464# File where found changes are written to 
    65 $change_file = getVar(name => "change_file", namespace => "HoneyClient::Agent::Integrity"), 
     65$change_file = getVar(name => "change_file"); 
    6666} 
    6767 
     
    160160 
    161161 
    162 # =begin testing 
    163 { 
    164 #Testing initRegistry() 
    165 my $ob = HoneyClient::Agent::Integrity->new(); 
    166  
    167 system("regedit.exe /s noTEST.reg"); 
    168 system("regedit.exe /s /c $test_dir/t1a.reg"); 
    169 $ob->initRegistry("HKEY_LOCAL_MACHINE\\HARDWARE\\TEST"); 
    170 open (DIFF, "diff $test_dir/t1a.reg clean.reg0 |") or die "Can't check the changes files\n"; 
    171 @result = <DIFF>; 
    172 close DIFF; 
    173 #Bad test because it will be empty in the case of an error anyway? 
    174 is(scalar(@result), 0, 'initRegistry: General Test'); 
    175 } 
    176  
    177  
    178  
    179 # =begin testing 
    180 { 
    181 my $ob = HoneyClient::Agent::Integrity->new(); 
    182  
    183 reg_test($ob, 1, "checkRegistry: case 1 Multi-line addition changes."); 
    184 reg_test($ob, 2, "checkRegistry: case 2 Single-line addition changes."); 
    185 reg_test($ob, 3, "checkRegistry: case 3 Multi-line deletion changes."); 
    186 reg_test($ob, 4, "checkRegistry: case 4 Single-line deletion changes."); 
    187 reg_test($ob, 5, "checkRegistry: case 5 Simple multi-line to multi-line changes."); 
    188 is(6, 6, "checkRegistry: case 6 - SKIPPING (currently can't recreate conditions for test)"); 
    189 #reg_test($ob, 6, "checkRegistry: case 6 Complicated multi-line to multi-line changes."); 
    190 reg_test($ob, 7, "checkRegistry: case 7 Simple multi-line to single-line changes."); 
    191 reg_test($ob, 8, "checkRegistry: case 8 Complicated multi-line to single-line changes."); 
    192 reg_test($ob, 9, "checkRegistry: case 9 Simple single-line to multi-line changes."); 
    193 reg_test($ob, 10, "checkRegistry: case 10 Complicated single-line to multi-line changes."); 
    194 reg_test($ob, 11, "checkRegistry: case 11 Simple single-line to single-line changes."); 
    195 reg_test($ob, 12, "checkRegistry: case12 Complicated single-line to single-line changes."); 
    196  
    197 sub reg_test{ 
    198 my $ob = shift; 
    199 my $num = shift; 
    200 my $string = shift; 
    201  
    202     #for safety 
    203     if(-e "temp_reg_export.reg"){ 
    204         system("mv temp_reg_export.reg temp_reg_export.reg.CBL"); 
    205     } 
    206     system('regedit.exe /a temp_reg_export.reg "HKEY_LOCAL_MACHINE\HARDWARE\TEST"'); 
    207  
    208     system("regedit.exe /s noTEST.reg"); 
    209     system("regedit.exe /s /c $test_dir/t" . "$num" . "a.reg"); 
    210     $ob->initRegistry("HKEY_LOCAL_MACHINE\\HARDWARE"); 
    211     system("regedit.exe /s noTEST.reg"); 
    212     system("regedit.exe /s /c $test_dir/t" . "$num" . "b.reg"); 
    213     $ob->checkRegistry("HKEY_LOCAL_MACHINE\\HARDWARE"); 
    214     open (DIFF, "diff $test_dir/t" . "$num" . "changes.txt changes.txt |") or die "Can't check the changes files\n"; 
    215     @result = <DIFF>; 
    216     close DIFF; 
    217     #Bad test because it will be empty in the case of an error anyway? 
    218     is(scalar(@result), 0, "$string"); 
    219  
    220     #for safety/cleanup 
    221     if(-e "temp_reg_export.reg"){ 
    222         system("regedit.exe /s noTEST.reg"); 
    223         system("regedit.exe /s /c temp_reg_export.reg"); 
    224         system("rm temp_reg_export.reg"); 
    225         if(-e "temp_reg_export.reg.CBL"){ 
    226             system("mv temp_reg_export.reg.CBL temp_reg_export.reg"); 
    227         } 
    228     } 
    229      
    230 } 
    231 } 
    232  
    233  
    234  
    235162 
    2361631; 
  • honeyclient/branches/exp/stephenson-link_scoring/t/honeyclient_manager_vm.t

    r13 r153  
    1414# Make sure Log::Log4perl loads 
    1515BEGIN { use_ok('Log::Log4perl', qw(:nowarn)) 
    16         or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly linsted within the path."); 
     16        or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly listed within the path."); 
    1717        
    1818        # Suppress all logging messages, since we need clean output for unit testing. 
     
    156156# TODO: Remove this once unit testing should actually be used. 
    157157# Ideally, this should be handled programmatically, based upon user prompt. 
    158 #exit; 
     158exit; 
    159159 
    160160# Generate a notice, to inform the tester that these tests are not 
  • honeyclient/branches/exp/stephenson-link_scoring/t/honeyclient_util_config.t

    r13 r153  
    1111# Make sure Log::Log4perl loads 
    1212BEGIN { use_ok('Log::Log4perl', qw(:nowarn)) 
    13         or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly linsted within the path."); 
     13        or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly listed within the path."); 
    1414        
    1515        # Suppress all logging messages, since we need clean output for unit testing. 
     
    5252# Make sure XML::Tidy loads 
    5353BEGIN { use_ok('XML::Tidy') 
    54         or diag("Can't load XML::Tidy package. Check to make sure the package library is correctly linsted within the path."); } 
     54        or diag("Can't load XML::Tidy package. Check to make sure the package library is correctly listed within the path."); } 
    5555require_ok('XML::Tidy'); 
    5656can_ok('XML::Tidy','tidy'); 
     
    6060# Make sure Data::Dumper loads 
    6161BEGIN { use_ok('Data::Dumper') 
    62         or diag("Can't load Data::Dumper package. Check to make sure the package library is correctly linsted within the path."); } 
     62        or diag("Can't load Data::Dumper package. Check to make sure the package library is correctly listed within the path."); } 
    6363require_ok('Data::Dumper'); 
    6464use Data::Dumper; 
  • honeyclient/branches/exp/stephenson-link_scoring/t/honeyclient_util_soap.t

    r13 r153  
    1111# Make sure Log::Log4perl loads 
    1212BEGIN { use_ok('Log::Log4perl', qw(:nowarn)) 
    13         or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly linsted within the path."); 
     13        or diag("Can't load Log::Log4perl package. Check to make sure the package library is correctly listed within the path."); 
    1414        
    1515        # Suppress all logging messages, since we need clean output for unit testing.