]> Dogcows Code - chaz/p5-File-KDBX/blob - t/files/bin/ykinfo
Fix YubiKey unit test portability issues
[chaz/p5-File-KDBX] / t / files / bin / ykinfo
1 #!/usr/bin/env perl
2
3 # This is a fake ykinfo program that provides canned responses, for testing.
4
5 use warnings;
6 use strict;
7
8 use Getopt::Std;
9
10 our ($opt_a, $opt_n);
11 getopts('an:');
12
13 my $device = $opt_n // -1;
14
15 if ($device == 0) {
16 print q{serial: 123
17 version: 2.0.0
18 touch_level: 0
19 vendor_id: 1050
20 product_id: 113
21 };
22 exit 0;
23 }
24 elsif ($device == 1) {
25 print q{serial: 456
26 version: 3.0.1
27 touch_level: 10
28 vendor_id: 1050
29 product_id: 401
30 };
31 exit 0;
32 }
33 else {
34 print STDERR "Yubikey core error: no yubikey present\n";
35 exit 1;
36 }
37
This page took 0.034979 seconds and 4 git commands to generate.