[ARVADOS] updated: 3dc08cb9e6222486dcaadd50e61cad26d3200289

git at public.curoverse.com git at public.curoverse.com
Wed Aug 12 16:43:36 EDT 2015


Summary of changes:
 sdk/pam/Dockerfile                                 |  2 +-
 .../pam/integration_tests}/__init__.py             |  0
 sdk/pam/integration_tests/test_pam.py              | 26 ++++++++++++++++++++
 sdk/pam/tests/test_integration.py                  | 28 ----------------------
 4 files changed, 27 insertions(+), 29 deletions(-)
 copy {services/fuse/tests/performance => sdk/pam/integration_tests}/__init__.py (100%)
 create mode 100644 sdk/pam/integration_tests/test_pam.py
 delete mode 100644 sdk/pam/tests/test_integration.py

       via  3dc08cb9e6222486dcaadd50e61cad26d3200289 (commit)
      from  7671ee342c26503984616eb6a864b44070b8f6d9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 3dc08cb9e6222486dcaadd50e61cad26d3200289
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Aug 12 16:41:38 2015 -0400

    6934: Move integration tests into separate dir.
    
    Now, "python setup.py --test-suite integration_tests" will run
    integration tests, and "python setup.py" won't -- regardless of
    whether you are root, and what your pam config looks like.

diff --git a/sdk/pam/Dockerfile b/sdk/pam/Dockerfile
index 24b50ab..5cee5cc 100644
--- a/sdk/pam/Dockerfile
+++ b/sdk/pam/Dockerfile
@@ -44,7 +44,7 @@ RUN useradd -ms /bin/bash active
 # Test with python (SIGSEGV during tests)
 #ADD . /pam
 #WORKDIR /pam
-#CMD rsyslogd & tail -F /var/log/auth.log & python setup.py test
+#CMD rsyslogd & tail -F /var/log/auth.log & python setup.py test --test-suite integration_tests
 
 # Test with perl (SIGSEGV when program exits)
 RUN apt-get install -qy libauthen-pam-perl
diff --git a/sdk/pam/integration_tests/__init__.py b/sdk/pam/integration_tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/sdk/pam/integration_tests/test_pam.py b/sdk/pam/integration_tests/test_pam.py
new file mode 100644
index 0000000..cfc915c
--- /dev/null
+++ b/sdk/pam/integration_tests/test_pam.py
@@ -0,0 +1,26 @@
+"""These tests assume we are running (in a docker container) with
+arvados_pam configured and a test API server running.
+"""
+import pam
+import unittest
+
+# From services/api/test/fixtures/api_client_authorizations.yml
+# because that file is not available during integration tests:
+ACTIVE_TOKEN = '3kg6k6lzmp9kj5cpkcoxie963cmvjahbt2fod9zru30k1jqdmi'
+SPECTATOR_TOKEN = 'zw2f4gwx8hw8cjre7yp6v1zylhrhn3m5gvjq73rtpwhmknrybu'
+
+class IntegrationTest(unittest.TestCase):
+    def setUp(self):
+        self.p = pam.pam()
+
+    def test_allow(self):
+        self.assertTrue(self.p.authenticate('active', ACTIVE_TOKEN, service='login'))
+
+    def test_deny_bad_token(self):
+        self.assertFalse(self.p.authenticate('active', 'thisisaverybadtoken', service='login'))
+
+    def test_deny_empty_token(self):
+        self.assertFalse(self.p.authenticate('active', '', service='login'))
+
+    def test_deny_permission(self):
+        self.assertFalse(self.p.authenticate('spectator', SPECTATOR_TOKEN, service='login'))
diff --git a/sdk/pam/tests/test_integration.py b/sdk/pam/tests/test_integration.py
deleted file mode 100644
index 53ef0ea..0000000
--- a/sdk/pam/tests/test_integration.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import os
-if os.path.exists('/usr/share/pam-configs/arvados') and os.getuid() == 0:
-    """These tests assume we are running (in a docker container) with
-    arvados_pam configured and a test API server running.
-    """
-    import pam
-    import unittest
-
-    # From services/api/test/fixtures/api_client_authorizations.yml
-    # because that file is not available during integration tests:
-    ACTIVE_TOKEN = '3kg6k6lzmp9kj5cpkcoxie963cmvjahbt2fod9zru30k1jqdmi'
-    SPECTATOR_TOKEN = 'zw2f4gwx8hw8cjre7yp6v1zylhrhn3m5gvjq73rtpwhmknrybu'
-
-    class IntegrationTest(unittest.TestCase):
-        def setUp(self):
-            self.p = pam.pam()
-
-        def test_allow(self):
-            self.assertTrue(self.p.authenticate('active', ACTIVE_TOKEN, service='login'))
-
-        def test_deny_bad_token(self):
-            self.assertFalse(self.p.authenticate('active', 'thisisaverybadtoken', service='login'))
-
-        def test_deny_empty_token(self):
-            self.assertFalse(self.p.authenticate('active', '', service='login'))
-
-        def test_deny_permission(self):
-            self.assertFalse(self.p.authenticate('spectator', SPECTATOR_TOKEN, service='login'))

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list