Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Improved Daemon Security and Updated Unittest.rst #383

Merged
merged 16 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ python:
# Setup services
services:
- mysql
- docker

# Setup global environmental variables
env:
Expand All @@ -32,4 +33,4 @@ install:

# Run the unittest scripts
script:
- tests/bin/do_all_tests.py --verbose
- tests/bin/do_all_tests.py --verbose
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions docs/unittest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------------
Expand Down
6 changes: 4 additions & 2 deletions setup/_pattoo/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup/_pattoo/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down
2 changes: 2 additions & 0 deletions setup/systemd/system/pattoo_api_agentd.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions setup/systemd/system/pattoo_apid.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions setup/systemd/system/pattoo_ingesterd.service
Original file line number Diff line number Diff line change
Expand Up @@ -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