5 use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
7 use afstest qw(src_path obj_path);
9 use File::Temp qw/tempdir/;
15 # Run tests/auth/writekeyfile, and check that the KeyFile that it generates
16 # matches what we expect.
18 if (!defined(gethostbyname(hostname()))) {
19 # writekeyfile needs a hostname to generate a config dir
20 plan skip_all => 'Cannot resolve hostname';
24 my $cmd = obj_path("tests/auth/writekeyfile");
25 $cmd = abs_path($cmd);
27 my $keyfile = src_path("tests/auth/KeyFile.short");
28 $keyfile = abs_path($keyfile);
30 my $dir = tempdir('afs_XXXXXX', CLEANUP => 1);
33 or die("chdir $dir failed: $?");
36 or die("$cmd failed: $?");
38 ok(compare("KeyFile", $keyfile) == 0,
39 "writekeyfile generates expected KeyFile");