]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use radiusd constants for the returns and comment rlm_python tests
authorGuillaume Pannatier <guillaume.pannatier@gmail.com>
Thu, 5 May 2016 07:34:53 +0000 (09:34 +0200)
committerGuillaume Pannatier <guillaume.pannatier@gmail.com>
Thu, 5 May 2016 07:34:53 +0000 (09:34 +0200)
src/tests/modules/python/auth_cext_compat.unlang
src/tests/modules/python/auth_multi_inst.unlang
src/tests/modules/python/auth_with_tls.unlang
src/tests/modules/python/mod1.py
src/tests/modules/python/mod2.py

index d6740550399549c0b1a22c6edeb338e89c81b12c..f055bda9265f3ca4f6375159d3dd1966df94a25c 100644 (file)
@@ -1,4 +1,5 @@
-pmod2
+# This module is cext_compat and should work
+pmod4_cextcompat
 if (!ok) {
     test_fail
 } else {
index 8e23fc8db0cdd224cd2f3592a564895dd9e39d24..56669269e0ef4647283b6e02fe9372dff5931737 100644 (file)
@@ -1,3 +1,4 @@
+# Call the second configured module firstly should work
 pmod2
 if (!ok) {
     test_fail
@@ -5,6 +6,7 @@ if (!ok) {
     test_pass
 }
 
+# Call the first configured module secondly
 pmod1
 if (!noop) {
     test_fail
index 3d0e6238aa863aca9471d121f2e183b7be012ba5..8baaac399d2fe413fb276d2cd33a1be6fc567c35 100644 (file)
@@ -1,3 +1,4 @@
+# The first call on pmod1 should store var "tls" in a thread local storage and return noop
 pmod1
 if (!noop) {
     test_fail
@@ -5,6 +6,7 @@ if (!noop) {
     test_pass
 }
 
+# Simply call another second module
 pmod2
 if (!ok) {
     test_fail
@@ -12,6 +14,7 @@ if (!ok) {
     test_pass
 }
 
+# The second call on pmod1 should return OK because "tls" is set
 pmod1
 if (!ok) {
     test_fail
@@ -19,6 +22,7 @@ if (!ok) {
     test_pass
 }
 
+# Calling another python module configured with mod1.py should be in it's own context and return NOOP on first call
 pmod3_withmod1
 if (!noop) {
     test_fail
@@ -26,20 +30,7 @@ if (!noop) {
     test_pass
 }
 
-pmod3_withmod1
-if (!ok) {
-    test_fail
-} else {
-    test_pass
-}
-
-pmod3_withmod1
-if (!ok) {
-    test_fail
-} else {
-    test_pass
-}
-
+# Should return "OK" on subsequent calls
 pmod3_withmod1
 if (!ok) {
     test_fail
index ddb4f8c24b23d3539b72ea3ca3b614d7055e2044..f2b2a5faa01513c787b3e095d30bbf23e051cabc 100644 (file)
@@ -1,3 +1,4 @@
+import radiusd
 import threading
 
 local = threading.local()
@@ -5,7 +6,7 @@ local = threading.local()
 def authorize(p):
     global local
     if hasattr(local, 'tls'):
-        return 2
+        return radiusd.RLM_MODULE_OK
     else:
         local.tls = True
-        return 7
\ No newline at end of file
+        return radiusd.RLM_MODULE_NOOP
\ No newline at end of file
index db9d6d69075af640e216aeeb2091a6aa15f707fc..9089d1aa7fb748dc26ce2d0c40ae57643ec20f9b 100644 (file)
@@ -1,2 +1,4 @@
+import radiusd
+
 def authorize(p):   
-    return 2
\ No newline at end of file
+    return radiusd.RLM_MODULE_OK
\ No newline at end of file