Skip to content

Commit

Permalink
Merge pull request #235 from datosgobar/fix-implementacion-ckanext-se…
Browse files Browse the repository at this point in the history
…curity

Tests para comprobar que no haya errores activando ckanext-security
  • Loading branch information
chdigiorno authored May 28, 2019
2 parents fc50445 + 63dd246 commit f6d5469
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Empty file.
27 changes: 27 additions & 0 deletions tests/configurations/security/tests_ckanext_security.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! coding: utf-8

import nose.tools as nt
import subprocess
from tests import TestPortalAndino


class TestCkanextSecurity(TestPortalAndino.TestPortalAndino):

def test_successful_plugin_enablement_and_disablement(self):
security_path = "/etc/ckan_init.d/security/"
enablement_script = "enable_ckanext_security.sh"
disablement_script = "disable_ckanext_security.sh"

# Enable
subprocess.check_call(
"docker exec -it andino {0}./{1}".format(security_path, enablement_script), shell=True)
cmd = "grep '## ckanext-security' /etc/ckan/default/production.ini"
search_result = subprocess.check_output("docker exec -it andino {}".format(cmd), shell=True).strip()
nt.assert_equal("## ckanext-security", search_result)

# Disable
subprocess.check_call(
"docker exec -it andino {0}./{1}".format(security_path, disablement_script), shell=True)
cmd = "{} || true".format(cmd)
search_result = subprocess.check_output("docker exec -it andino {}".format(cmd), shell=True).strip()
nt.assert_equal("", search_result)

0 comments on commit f6d5469

Please sign in to comment.