]> git.saurik.com Git - apple/security.git/blob - SecurityTests/regressions/t/41kc-unlock-referral.t
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / regressions / t / 41kc-unlock-referral.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use warnings;
5 BEGIN { require 't/security.pl' };
6 plan_security tests => 7;
7
8 $ENV{HOME}="/tmp/test$$";
9 ok(mkdir($ENV{HOME}), 'setup home');
10 my $source = "$ENV{HOME}/source";
11 my $dest = "$ENV{HOME}/dest";
12 is_output('security', 'create-keychain', ['-p', 'test', $source],
13 [],
14 'create source');
15 is_output('security', 'create-keychain', ['-p', 'test', $dest],
16 [],
17 'create dest');
18 SKIP: {
19 skip "systemkeychain brings up UI", 1;
20
21 is_output('systemkeychain', '-k', [$dest, '-s', $source],
22 [],
23 'systemkeychain');
24 }
25 is_output('security', 'lock-keychain', [$source],
26 [],
27 'lock source');
28 SKIP: {
29 skip "systemkeychain bring up UI", 1;
30
31 is_output('security', 'unlock-keychain', ['-u', $source],
32 [],
33 'unlock source w/ referal');
34 }
35 ok(system("rm -rf '$ENV{HOME}'") eq 0, 'cleanup home');
36
37 1;