diff --git a/.travis.yml b/.travis.yml index db40fe58..879e5fca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ python: # Setup services services: - mysql + - docker # Setup global environmental variables env: @@ -32,4 +33,4 @@ install: # Run the unittest scripts script: - - tests/bin/do_all_tests.py --verbose + - tests/bin/do_all_tests.py --verbose \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 94b5ab60..86ef2f00 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,8 +21,10 @@ General information about the project, including the the prerequisite steps to g about installation + installation_modes configuration systemd + docker backup Daemon and Cron Setup diff --git a/docs/unittest.rst b/docs/unittest.rst index 04506fde..d8148cfc 100644 --- a/docs/unittest.rst +++ b/docs/unittest.rst @@ -36,6 +36,17 @@ Create a database and grant full privileges to the `travis` user. MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit; # + +Setting up Database Tables +-------------------------- + +Running the following script will set up the database tables and your environment for unittesting + + +.. code-block:: text + + $ setup/install.py developer all + Setting up Syslog Error Codes ----------------------------- diff --git a/setup/_pattoo/docker.py b/setup/_pattoo/docker.py index 804b5c98..22275597 100644 --- a/setup/_pattoo/docker.py +++ b/setup/_pattoo/docker.py @@ -172,8 +172,10 @@ def install(container_name, config_files, verbose=True): docker_check() # Build pattoo container - image_check('pattoo') - print('Building Pattoo Container. This could take some time...') + image_check(container_name) + message = '''\ +Building {} Container. This could take some time...'''.format(container_name) + print(message) shared.run_script('docker build -t {} .'.format(container_name)) # Run container in detached mode as pattoo diff --git a/setup/_pattoo/shared.py b/setup/_pattoo/shared.py index 5d7f30cf..7d1ae6d8 100644 --- a/setup/_pattoo/shared.py +++ b/setup/_pattoo/shared.py @@ -108,7 +108,7 @@ def unittest_environment_setup(): def root_check(): - """Check if the user is root. + """Check if the user is root or travis. Args: None diff --git a/setup/install.py b/setup/install.py index a571565b..b88a3ed5 100755 --- a/setup/install.py +++ b/setup/install.py @@ -373,7 +373,7 @@ def main(): # Builds docker container and installs pattoo elif args.qualifier == 'docker': print('Installing pattoo docker container') - if shared.root_check() is True: + if shared.root_check() is True or getpass.getuser() == 'travis': docker.install('pattoo', config_files) else: shared.log('You need to be running as root.') diff --git a/setup/systemd/system/pattoo_api_agentd.service b/setup/systemd/system/pattoo_api_agentd.service index 970398bb..c23592bc 100644 --- a/setup/systemd/system/pattoo_api_agentd.service +++ b/setup/systemd/system/pattoo_api_agentd.service @@ -15,6 +15,8 @@ ExecReload=INSTALLATION_DIRECTORY/bin/pattoo_api_agentd.py --restart RemainAfterExit=yes GuessMainPID=yes Type=forking +ProtectSystem=full +ProtectHome=read-only [Install] WantedBy=multi-user.target diff --git a/setup/systemd/system/pattoo_apid.service b/setup/systemd/system/pattoo_apid.service index 7769305a..01a02ad1 100644 --- a/setup/systemd/system/pattoo_apid.service +++ b/setup/systemd/system/pattoo_apid.service @@ -15,6 +15,8 @@ ExecReload=INSTALLATION_DIRECTORY/bin/pattoo_apid.py --restart RemainAfterExit=yes GuessMainPID=yes Type=forking +ProtectSystem=full +ProtectHome=read-only [Install] WantedBy=multi-user.target diff --git a/setup/systemd/system/pattoo_ingesterd.service b/setup/systemd/system/pattoo_ingesterd.service index 003204e7..344d0634 100644 --- a/setup/systemd/system/pattoo_ingesterd.service +++ b/setup/systemd/system/pattoo_ingesterd.service @@ -15,6 +15,8 @@ ExecReload=INSTALLATION_DIRECTORY/bin/pattoo_ingesterd.py --restart RemainAfterExit=yes GuessMainPID=yes Type=forking +ProtectSystem=full +ProtectHome=read-only [Install] WantedBy=multi-user.target