6 use File::Temp qw/tempdir/;
13 # Run tests/auth/writekeyfile, and check that the KeyFile that it generates
14 # matches what we expect.
16 if (!defined(gethostbyname(hostname()))) {
17 # writekeyfile needs a hostname to generate a config dir
18 plan skip_all => 'Cannot resolve hostname';
23 if (defined($ENV{C_TAP_BUILD})) {
24 $cmd = $ENV{C_TAP_BUILD} . "/auth/writekeyfile";
26 $cmd = $Bin . "/writekeyfile";
28 $cmd = abs_path($cmd);
31 if (defined($ENV{C_TAP_SOURCE})) {
32 $keyfile = $ENV{C_TAP_SOURCE} . "/auth/KeyFile.short";
34 $keyfile = $Bin . "/KeyFile.short";
36 $keyfile = abs_path($keyfile);
38 my $dir = tempdir('afs_XXXXXX', CLEANUP => 1);
41 or die("chdir $dir failed: $?");
44 or die("$cmd failed: $?");
46 ok(compare("KeyFile", $keyfile) == 0,
47 "writekeyfile generates expected KeyFile");