Ignore:
Timestamp:
05/30/12 23:09:16 (12 years ago)
Author:
nanardon
Message:
  • more test for sql base
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/live-test/10_sql.t

    r1028 r1031  
    1616    plan skip_all => 'No SQL base defined'; 
    1717} else { 
    18     plan tests => 16; # Number of test 
     18    plan tests => 32; # Number of test 
    1919} 
    2020 
     
    3636is($obj->get_attributes('sn'), "snUser"); 
    3737 
     38my $passwd = genid(); 
     39ok($obj->set_password($passwd), "Can set password"); 
     40ok($base->authenticate_user($oid, $passwd), "can authenticate user"); 
     41ok(!$base->authenticate_user($oid, '----'), 
     42    "don't authenticate with invalid password"); 
     43 
    3844ok($base->delete_object('user', $oid), "Can delete user $oid"); 
    3945ok(!$base->get_object('user', $oid), "user $oid is actually deleted"); 
     
    4147 
    4248 
    43 { # test: user 
     49{ # test: group 
    4450my $oid = genid(); 
    4551 
     
    5460ok(!$base->get_object('group', $oid), "group $oid is actually deleted"); 
    5561} 
     62 
     63{ # test: nethost 
     64my $oid = genid(); 
     65 
     66use_ok('LATMOS::Accounts::Bases::Sql::Nethost'); 
     67ok($base->create_c_object('nethost', $oid, 
     68    description => 'Nethost Test', 
     69    ip => '255.255.255.255', # widely improbable to conflict with existing one 
     70), "Can create nethost $oid"); 
     71ok(my $obj = $base->get_object('nethost', $oid), "nethost $oid is actually deleted"); 
     72is($obj->get_attributes('description'), "Nethost Test"); 
     73is($obj->get_attributes('ip'), '255.255.255.255'); 
     74 
     75ok($base->delete_object('nethost', $oid), "Can delete nethost $oid"); 
     76ok(!$base->get_object('nethost', $oid), "nethost $oid is actually deleted"); 
     77} 
     78 
     79{ # test: netzone 
     80my $oid = genid(); 
     81 
     82use_ok('LATMOS::Accounts::Bases::Sql::Netzone'); 
     83ok($base->create_c_object('netzone', $oid, 
     84    description => 'Netzone Test', 
     85    type => 'dhcp', 
     86), "Can create netzone $oid"); 
     87ok(my $obj = $base->get_object('netzone', $oid), "netzone $oid is actually deleted"); 
     88is($obj->get_attributes('description'), "Netzone Test"); 
     89 
     90ok($base->delete_object('netzone', $oid), "Can delete netzone $oid"); 
     91ok(!$base->get_object('netzone', $oid), "netzone $oid is actually deleted"); 
     92} 
Note: See TracChangeset for help on using the changeset viewer.