diff options
author | Derek Straka <derek@asterius.io> | 2017-09-29 14:53:20 -0400 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2017-10-11 16:22:49 -0400 |
commit | bd4dc896642f3074bf7ed260f6cf765733d721a7 (patch) | |
tree | 41944e0348e3effbbc2678113a6aba56a5be103e /meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch | |
parent | 68443bd22e48782a94db7ce6c3d6cd40f42c9c5a (diff) | |
download | meta-openembedded-bd4dc896642f3074bf7ed260f6cf765733d721a7.tar.gz |
libauthen-radius-perl: move recipe to meta-networking
Recipe depends on radius which is located in meta-networking
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch')
-rw-r--r-- | meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch b/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch new file mode 100644 index 000000000..9798af497 --- /dev/null +++ b/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch | |||
@@ -0,0 +1,90 @@ | |||
1 | From 829302792bf0e4935d29efc23ca1f2e9e7ee7dfd Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Thu, 7 Jan 2016 03:12:38 -0500 | ||
4 | Subject: [PATCH] test.pl: adjust for ptest | ||
5 | |||
6 | * Don't use interactive inputs, set default test | ||
7 | settings instead. | ||
8 | * Change the test results output to the ptest format | ||
9 | |||
10 | Upstream-Status: Inappropriate [OE ptest specific] | ||
11 | |||
12 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
13 | --- | ||
14 | test.pl | 31 ++++++++++++++++++------------- | ||
15 | 1 file changed, 18 insertions(+), 13 deletions(-) | ||
16 | |||
17 | diff --git a/test.pl b/test.pl | ||
18 | index cfd1c1e..9b4f10e 100644 | ||
19 | --- a/test.pl | ||
20 | +++ b/test.pl | ||
21 | @@ -7,11 +7,11 @@ | ||
22 | # Change 1..1 below to 1..last_test_to_print . | ||
23 | # (It may become useful if the test is moved to ./t subdirectory.) | ||
24 | |||
25 | -BEGIN {print "1..5\n";} | ||
26 | -END {print "not ok 1\n" unless $loaded;} | ||
27 | +BEGIN {print "Start testing for libauthen-radius-perl\n";} | ||
28 | +END {print "\nFAIL: test1\n" unless $loaded;} | ||
29 | use Authen::Radius; | ||
30 | $loaded = 1; | ||
31 | -print "ok 1\n"; | ||
32 | +print "\nPASS: test1\n"; | ||
33 | |||
34 | ######################### End of black magic. | ||
35 | |||
36 | @@ -19,26 +19,31 @@ print "ok 1\n"; | ||
37 | # (correspondingly "not ok 13") depending on the success of chunk 13 | ||
38 | # of the test code): | ||
39 | |||
40 | +$host = "127.0.0.1"; | ||
41 | +$secret = "testing123"; | ||
42 | +$user = "testing"; | ||
43 | +$pwd = "testpassword"; | ||
44 | + | ||
45 | print "Make sure this machine is in your Radius clients file!\n"; | ||
46 | -print "Enter hostname[:port] of your Radius server: "; chomp ($host = <STDIN>); | ||
47 | -print "Enter shared-secret of your Radius server: "; chomp ($secret = <STDIN>); | ||
48 | -print "Enter a username to be validated: "; chomp ($user = <STDIN>); | ||
49 | -print "Enter this user's password: "; chomp ($pwd = <STDIN>); | ||
50 | +print "hostname of your Radius server: $host\n"; | ||
51 | +print "shared-secret of your Radius server: $secret\n"; | ||
52 | +print "The username to be validated: $user\n"; | ||
53 | +print "The user's password: $pwd\n"; | ||
54 | |||
55 | $t = 2; | ||
56 | if ($host ne '') { | ||
57 | $r = new Authen::Radius(Host => $host, Secret => $secret, Debug => 1); | ||
58 | - print defined($r) ? "" : "not ", "ok $t\n"; $t++; | ||
59 | + print defined($r) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++; | ||
60 | #Authen::Radius->load_dictionary; | ||
61 | - print $r->check_pwd($user, $pwd) ? "" : "not ", "ok $t\n"; $t++; | ||
62 | + print $r->check_pwd($user, $pwd) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++; | ||
63 | @a = $r->get_attributes; | ||
64 | - print $#a != -1 ? "" : "not ", "ok $t\n"; $t++; | ||
65 | + print $#a != -1 ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++; | ||
66 | #for $a (@a) { | ||
67 | # print "attr: name=$a->{'Name'} value=$a->{'Value'}\n"; | ||
68 | #} | ||
69 | } else { | ||
70 | foreach my $t (2..4) { | ||
71 | - print "skipped $t\n"; | ||
72 | + print "\nSKIP test$t\n"; | ||
73 | } | ||
74 | } | ||
75 | |||
76 | @@ -53,9 +58,9 @@ my $data = "what do ya want for nothing?"; | ||
77 | my $etalon_digest = hex_to_ascii("750c783e6ab0b503eaa86e310a5db738"); | ||
78 | my $digest = Authen::Radius::hmac_md5(undef, $data, $key); | ||
79 | if ($etalon_digest eq $digest) { | ||
80 | - print "ok 5\n"; | ||
81 | + print "\nPASS: test5\n"; | ||
82 | } else { | ||
83 | - print "not ok 5\n"; | ||
84 | + print "\nFAIL: test5\n"; | ||
85 | } | ||
86 | |||
87 | exit; | ||
88 | -- | ||
89 | 1.9.1 | ||
90 | |||