Changeset 1031 for trunk/LATMOS-Accounts/live-test/10_sql.t
- Timestamp:
- 05/30/12 23:09:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/live-test/10_sql.t
r1028 r1031 16 16 plan skip_all => 'No SQL base defined'; 17 17 } else { 18 plan tests => 16; # Number of test18 plan tests => 32; # Number of test 19 19 } 20 20 … … 36 36 is($obj->get_attributes('sn'), "snUser"); 37 37 38 my $passwd = genid(); 39 ok($obj->set_password($passwd), "Can set password"); 40 ok($base->authenticate_user($oid, $passwd), "can authenticate user"); 41 ok(!$base->authenticate_user($oid, '----'), 42 "don't authenticate with invalid password"); 43 38 44 ok($base->delete_object('user', $oid), "Can delete user $oid"); 39 45 ok(!$base->get_object('user', $oid), "user $oid is actually deleted"); … … 41 47 42 48 43 { # test: user49 { # test: group 44 50 my $oid = genid(); 45 51 … … 54 60 ok(!$base->get_object('group', $oid), "group $oid is actually deleted"); 55 61 } 62 63 { # test: nethost 64 my $oid = genid(); 65 66 use_ok('LATMOS::Accounts::Bases::Sql::Nethost'); 67 ok($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"); 71 ok(my $obj = $base->get_object('nethost', $oid), "nethost $oid is actually deleted"); 72 is($obj->get_attributes('description'), "Nethost Test"); 73 is($obj->get_attributes('ip'), '255.255.255.255'); 74 75 ok($base->delete_object('nethost', $oid), "Can delete nethost $oid"); 76 ok(!$base->get_object('nethost', $oid), "nethost $oid is actually deleted"); 77 } 78 79 { # test: netzone 80 my $oid = genid(); 81 82 use_ok('LATMOS::Accounts::Bases::Sql::Netzone'); 83 ok($base->create_c_object('netzone', $oid, 84 description => 'Netzone Test', 85 type => 'dhcp', 86 ), "Can create netzone $oid"); 87 ok(my $obj = $base->get_object('netzone', $oid), "netzone $oid is actually deleted"); 88 is($obj->get_attributes('description'), "Netzone Test"); 89 90 ok($base->delete_object('netzone', $oid), "Can delete netzone $oid"); 91 ok(!$base->get_object('netzone', $oid), "netzone $oid is actually deleted"); 92 }
Note: See TracChangeset
for help on using the changeset viewer.