Browse Source

Fix error of file clean.py and secure.py and added test cases

bugfixes
shital.rtcamp 10 years ago
parent
commit
aac18a6d65
  1. 2
      ee/cli/plugins/clean.py
  2. 6
      ee/cli/plugins/secure.py
  3. 0
      tests/cli/13_test_stack.py
  4. 4
      tests/cli/2_test_stack_services_start.py
  5. 4
      tests/cli/3_test_stack_services_status.py
  6. 4
      tests/cli/4_test_stack_services_stop.py
  7. 4
      tests/cli/5_test_stack_services_restart.py
  8. 16
      tests/cli/92_test_site_cd.py
  9. 25
      tests/cli/97_test_site_update.py
  10. 0
      tests/cli/test_clean.py
  11. 6
      tests/cli/test_debug.py
  12. 0
      tests/cli/test_secure.py

2
ee/cli/plugins/clean.py

@ -51,7 +51,7 @@ class EECleanController(CementBaseController):
@expose(hide=True)
def clean_memcache(self):
try:
if(EEAptGet.is_installed("memcached")):
if(EEAptGet.is_installed(self, "memcached")):
EEService.restart_service(self, "memcached")
Log.info(self, "Cleaning MemCache")
else:

6
ee/cli/plugins/secure.py

@ -71,17 +71,13 @@ class EESecureController(CementBaseController):
if EEVariables.ee_platform_distro == 'Ubuntu':
EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
"{port} default_server ssl spdy;/\" "
"/etc/nginx/sites-available/22222"
"/etc/nginx/sites-available/22222.conf"
.format(port=port))
else:
Log.error(self, "Unable to change EasyEngine admin port")
if EEVariables.ee_platform_distro == 'Debian':
EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
"{port} default_server ssl;/\" "
"/etc/nginx/sites-available/22222"
.format(port=port))
else:
Log.error(self, "Unable to change EasyEngine admin port")
@expose(hide=True)
def secure_ip(self):

0
tests/cli/1_test_stack.py → tests/cli/13_test_stack.py

4
tests/cli/2_test_stack_services_start.py

@ -16,7 +16,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_start_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'start', '--php5-fpm'])
self.app = get_test_app(argv=['stack', 'start', '--php'])
self.app.setup()
self.app.run()
self.app.close()
@ -34,7 +34,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_start_memcached(self):
self.app = get_test_app(argv=['stack', 'start', '--memcached'])
self.app = get_test_app(argv=['stack', 'start', '--memcache'])
self.app.setup()
self.app.run()
self.app.close()

4
tests/cli/3_test_stack_services_status.py

@ -16,7 +16,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_status_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'status', '--php5-fpm'])
self.app = get_test_app(argv=['stack', 'status', '--php'])
self.app.setup()
self.app.run()
self.app.close()
@ -34,7 +34,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_status_memcached(self):
self.app = get_test_app(argv=['stack', 'status', '--memcached'])
self.app = get_test_app(argv=['stack', 'status', '--memcache'])
self.app.setup()
self.app.run()
self.app.close()

4
tests/cli/4_test_stack_services_stop.py

@ -16,7 +16,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_stop_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'stop', '--php5-fpm'])
self.app = get_test_app(argv=['stack', 'stop', '--php'])
self.app.setup()
self.app.run()
self.app.close()
@ -34,7 +34,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_stop_memcached(self):
self.app = get_test_app(argv=['stack', 'stop', '--memcached'])
self.app = get_test_app(argv=['stack', 'stop', '--memcache'])
self.app.setup()
self.app.run()
self.app.close()

4
tests/cli/5_test_stack_services_restart.py

@ -16,7 +16,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_restart_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'restart', '--php5-fpm'])
self.app = get_test_app(argv=['stack', 'restart', '--php'])
self.app.setup()
self.app.run()
self.app.close()
@ -34,7 +34,7 @@ class CliTestCaseStack(test.EETestCase):
self.app.close()
def test_ee_cli_stack_services_restart_memcached(self):
self.app = get_test_app(argv=['stack', 'restart', '--memcached'])
self.app = get_test_app(argv=['stack', 'restart', '--memcache'])
self.app.setup()
self.app.run()
self.app.close()

16
tests/cli/92_test_site_cd.py

@ -1,16 +0,0 @@
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseSite(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_show_cd(self):
self.app = get_test_app(argv=['site', 'cd', 'example.com'])
self.app.setup()
self.app.run()
self.app.close()

25
tests/cli/97_test_site_update.py

@ -9,43 +9,36 @@ class CliTestCaseSite(test.EETestCase):
self.app.run()
self.app.close()
def test_ee_cli_site_update(self):
self.app = get_test_app(argv=['site', 'update', 'example3.com',
'--password'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_site_update_html(self):
self.app = get_test_app(argv=['site', 'update', 'example4.com',
'--php'])
self.app = get_test_app(argv=['site', 'update', 'example2.com',
'--html'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_site_update_php(self):
self.app = get_test_app(argv=['site', 'update', 'example3.com',
self.app = get_test_app(argv=['site', 'update', 'example1.com',
'--php'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_site_update_mysql(self):
self.app = get_test_app(argv=['site', 'update', 'example4.com',
'--mysql'])
self.app = get_test_app(argv=['site', 'update', 'example1.com',
'--html'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_site_update_wp(self):
self.app = get_test_app(argv=['site', 'update', 'example4.com',
'--mysql'])
self.app = get_test_app(argv=['site', 'update', 'example5.com',
'--wp'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_site_update_wpsubdir(self):
self.app = get_test_app(argv=['site', 'update', 'example6.com',
self.app = get_test_app(argv=['site', 'update', 'example4.com',
'--wpsubdir'])
self.app.setup()
self.app.run()
@ -73,7 +66,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_update_wpsc(self):
self.app = get_test_app(argv=['site', 'update', 'example1.com',
self.app = get_test_app(argv=['site', 'update', 'example6.com',
'--wpsc'])
self.app.setup()
self.app.run()

0
tests/cli/52_test_clean.py → tests/cli/test_clean.py

6
tests/cli/test_debug.py

@ -93,9 +93,3 @@ class CliTestCaseDebug(test.EETestCase):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_debug(self):
self.app = get_test_app(argv=['debug'])
self.app.setup()
self.app.run()
self.app.close()

0
tests/cli/51_test_secure.py → tests/cli/test_secure.py

Loading…
Cancel
Save