Aut

 view release on metacpan or  search on metacpan

test.pl  view on Meta::CPAN

$aut->change_pass($ticket);

if ($ticket->valid()) {
  my $text="This is a text!!";

  my $ciphertext=$ticket->encrypt($text);
  print $ciphertext,"\n";
  my $dtext=$ticket->decrypt($ciphertext);
  print $dtext,"\n";

  ok();

  
  tt("Testing symmetric encryption");

  if ($text eq $dtext) {
    ok();
  }
  else {
    nok();
  }

  tt("Testing bag 1");

  $aut->set($ticket,"var","value");
  $aut->set($ticket,"var1","value1");
  if ($aut->get($ticket,"var1") eq "value1") {
    ok();
  }
  else {
    nok();
  }

  if ($aut->get($ticket,"var") eq "value") {
    ok();
  }
  else {
    nok();
  }

  $aut->del($ticket,"var1");
  if ($aut->get($ticket,"var1") eq undef) {
    ok();
  }
  else {
    nok();
  }
}

ok();

################################################################
# Post message
################################################################

print <<EOF
You can repeat this test, after adding some accounts with different
authorization levels. Try e.g.:

- Installing with an account without 'admin' rights.
- Logging in with an invalid account (login will prompt you max. 3 times).
- Enter false data while changing the password.
- Change passwords from the admin menu.
- Change rights from the admin menu.
- Delete all accounts.
- Change rights of all accounts until and including the last admin account.

etc.

EOF











( run in 0.313 second using v1.01-cache-2.11-cpan-0b5f733616e )