added my Recipes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
for case in `find t -type f -name '*.t'`; do
|
||||
perl $case >$case.output 2>&1
|
||||
ret=$?
|
||||
cat $case.output
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "FAIL: ${case%.t}"
|
||||
elif grep -i 'SKIP' $case.output; then
|
||||
echo "SKIP: ${case%.t}"
|
||||
else
|
||||
echo "PASS: ${case%.t}"
|
||||
fi
|
||||
|
||||
rm -f $case.output
|
||||
done
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
|
||||
# prepare testing config
|
||||
CONF_USERS=`readlink -f /etc/raddb/users`
|
||||
mv ${CONF_USERS} ${CONF_USERS}_orig
|
||||
echo "testing Cleartext-Password := \"testpassword\"" > ${CONF_USERS}
|
||||
cat ${CONF_USERS}_orig >> ${CONF_USERS}
|
||||
|
||||
# restart radiusd server
|
||||
systemctl restart radiusd || /etc/init.d/radiusd restart || {
|
||||
echo "FAIL: Start radiusd service."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# run teests
|
||||
perl test.pl
|
||||
|
||||
# restore the config and restart
|
||||
mv ${CONF_USERS}_orig ${CONF_USERS}
|
||||
systemctl restart radiusd || /etc/init.d/radiusd restart
|
||||
@@ -0,0 +1,90 @@
|
||||
From 829302792bf0e4935d29efc23ca1f2e9e7ee7dfd Mon Sep 17 00:00:00 2001
|
||||
From: Jackie Huang <jackie.huang@windriver.com>
|
||||
Date: Thu, 7 Jan 2016 03:12:38 -0500
|
||||
Subject: [PATCH] test.pl: adjust for ptest
|
||||
|
||||
* Don't use interactive inputs, set default test
|
||||
settings instead.
|
||||
* Change the test results output to the ptest format
|
||||
|
||||
Upstream-Status: Inappropriate [OE ptest specific]
|
||||
|
||||
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
|
||||
---
|
||||
test.pl | 31 ++++++++++++++++++-------------
|
||||
1 file changed, 18 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/test.pl b/test.pl
|
||||
index cfd1c1e..9b4f10e 100644
|
||||
--- a/test.pl
|
||||
+++ b/test.pl
|
||||
@@ -7,11 +7,11 @@
|
||||
# Change 1..1 below to 1..last_test_to_print .
|
||||
# (It may become useful if the test is moved to ./t subdirectory.)
|
||||
|
||||
-BEGIN {print "1..5\n";}
|
||||
-END {print "not ok 1\n" unless $loaded;}
|
||||
+BEGIN {print "Start testing for libauthen-radius-perl\n";}
|
||||
+END {print "\nFAIL: test1\n" unless $loaded;}
|
||||
use Authen::Radius;
|
||||
$loaded = 1;
|
||||
-print "ok 1\n";
|
||||
+print "\nPASS: test1\n";
|
||||
|
||||
######################### End of black magic.
|
||||
|
||||
@@ -19,26 +19,31 @@ print "ok 1\n";
|
||||
# (correspondingly "not ok 13") depending on the success of chunk 13
|
||||
# of the test code):
|
||||
|
||||
+$host = "127.0.0.1";
|
||||
+$secret = "testing123";
|
||||
+$user = "testing";
|
||||
+$pwd = "testpassword";
|
||||
+
|
||||
print "Make sure this machine is in your Radius clients file!\n";
|
||||
-print "Enter hostname[:port] of your Radius server: "; chomp ($host = <STDIN>);
|
||||
-print "Enter shared-secret of your Radius server: "; chomp ($secret = <STDIN>);
|
||||
-print "Enter a username to be validated: "; chomp ($user = <STDIN>);
|
||||
-print "Enter this user's password: "; chomp ($pwd = <STDIN>);
|
||||
+print "hostname of your Radius server: $host\n";
|
||||
+print "shared-secret of your Radius server: $secret\n";
|
||||
+print "The username to be validated: $user\n";
|
||||
+print "The user's password: $pwd\n";
|
||||
|
||||
$t = 2;
|
||||
if ($host ne '') {
|
||||
$r = new Authen::Radius(Host => $host, Secret => $secret, Debug => 1);
|
||||
- print defined($r) ? "" : "not ", "ok $t\n"; $t++;
|
||||
+ print defined($r) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
|
||||
#Authen::Radius->load_dictionary;
|
||||
- print $r->check_pwd($user, $pwd) ? "" : "not ", "ok $t\n"; $t++;
|
||||
+ print $r->check_pwd($user, $pwd) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
|
||||
@a = $r->get_attributes;
|
||||
- print $#a != -1 ? "" : "not ", "ok $t\n"; $t++;
|
||||
+ print $#a != -1 ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
|
||||
#for $a (@a) {
|
||||
# print "attr: name=$a->{'Name'} value=$a->{'Value'}\n";
|
||||
#}
|
||||
} else {
|
||||
foreach my $t (2..4) {
|
||||
- print "skipped $t\n";
|
||||
+ print "\nSKIP test$t\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +58,9 @@ my $data = "what do ya want for nothing?";
|
||||
my $etalon_digest = hex_to_ascii("750c783e6ab0b503eaa86e310a5db738");
|
||||
my $digest = Authen::Radius::hmac_md5(undef, $data, $key);
|
||||
if ($etalon_digest eq $digest) {
|
||||
- print "ok 5\n";
|
||||
+ print "\nPASS: test5\n";
|
||||
} else {
|
||||
- print "not ok 5\n";
|
||||
+ print "\nFAIL: test5\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
--
|
||||
1.9.1
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
SUMMARY = "Authen::Radius - provide simple Radius client facilities"
|
||||
DESCRIPTION = "The Authen::Radius module provides a simple class that \
|
||||
allows you to send/receive Radius requests/responses to/from a \
|
||||
Radius server. \
|
||||
"
|
||||
|
||||
HOMEPAGE = "http://search.cpan.org/~manowar/RadiusPerl"
|
||||
SECTION = "libs"
|
||||
|
||||
LICENSE = "Artistic-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=78ab6ea0cba1f1ec1680ebb149e3bc11"
|
||||
|
||||
DEPENDS = "perl"
|
||||
|
||||
SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MA/MANOWAR/RadiusPerl-${PV}.tar.gz \
|
||||
file://test.pl-adjust-for-ptest.patch \
|
||||
file://run-ptest \
|
||||
"
|
||||
SRC_URI[md5sum] = "d1fe2d6ecf7ea99299e4e3a8f945aad8"
|
||||
SRC_URI[sha256sum] = "3b276506986ccaa4949d92b13ce053a0017ad11562a991cc753364923fe81ca7"
|
||||
|
||||
S = "${WORKDIR}/Authen-Radius-${PV}"
|
||||
|
||||
inherit cpan ptest
|
||||
|
||||
do_install_ptest() {
|
||||
install -m 0755 ${S}/test.pl ${D}${PTEST_PATH}
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += "\
|
||||
libdata-hexdump-perl \
|
||||
perl-module-digest-md5 \
|
||||
perl-module-data-dumper \
|
||||
perl-module-io-select \
|
||||
perl-module-io-socket \
|
||||
"
|
||||
RDEPENDS:${PN}-ptest += " \
|
||||
${@bb.utils.contains('PTEST_ENABLED', '1', 'freeradius', '', d)} \
|
||||
"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
|
||||
python() {
|
||||
if bb.utils.contains('PTEST_ENABLED', '1', 'True', 'False', d) and \
|
||||
'networking-layer' not in d.getVar('BBFILE_COLLECTIONS').split():
|
||||
raise bb.parse.SkipRecipe('ptest requires meta-networking to be present.')
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
SUMMARY = "SASL Authentication framework for Perl"
|
||||
DESCRIPTION = "SASL is a generic mechanism for authentication used by several network \
|
||||
protocols. Authen::SASL provides an implementation framework that all \
|
||||
protocols should be able to share."
|
||||
HOMEPAGE = "http://search.cpan.org/dist/Authen-SASL/"
|
||||
SECTION = "libs"
|
||||
|
||||
LICENSE = "Artistic-1.0 | GPL-1.0-or-later"
|
||||
LIC_FILES_CHKSUM = "file://lib/Authen/SASL/Perl.pm;beginline=1;endline=3;md5=17123315bbcda19f484c07227594a609"
|
||||
|
||||
DEPENDS = "perl"
|
||||
RDEPENDS:${PN} = "libdigest-hmac-perl"
|
||||
|
||||
SRC_URI = "http://www.cpan.org/authors/id/G/GB/GBARR/Authen-SASL-${PV}.tar.gz \
|
||||
file://run-ptest \
|
||||
"
|
||||
SRC_URI[md5sum] = "7c03a689d4c689e5a9e2f18a1c586b2f"
|
||||
SRC_URI[sha256sum] = "6614fa7518f094f853741b63c73f3627168c5d3aca89b1d02b1016dc32854e09"
|
||||
|
||||
S = "${WORKDIR}/Authen-SASL-${PV}"
|
||||
|
||||
inherit cpan ptest
|
||||
|
||||
export PERL_USE_UNSAFE_INC = "1"
|
||||
|
||||
do_install_ptest () {
|
||||
cp -r ${B}/t ${D}${PTEST_PATH}
|
||||
}
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
Reference in New Issue
Block a user