mirror of https://github.com/MISP/MISP
fix: [tests] just messin' around.
parent
65354d2ec3
commit
0f860732af
|
@ -73,7 +73,7 @@ jobs:
|
||||||
composer install --no-progress
|
composer install --no-progress
|
||||||
popd
|
popd
|
||||||
cp -fa INSTALL/setup/config.php app/Plugin/CakeResque/Config/config.php
|
cp -fa INSTALL/setup/config.php app/Plugin/CakeResque/Config/config.php
|
||||||
|
|
||||||
# Set perms
|
# Set perms
|
||||||
sudo chown -R $USER:www-data `pwd`
|
sudo chown -R $USER:www-data `pwd`
|
||||||
sudo chmod -R 775 `pwd`
|
sudo chmod -R 775 `pwd`
|
||||||
|
@ -85,17 +85,17 @@ jobs:
|
||||||
sudo chmod -R g+ws `pwd`/app/files
|
sudo chmod -R g+ws `pwd`/app/files
|
||||||
sudo chmod -R g+ws `pwd`/app/files/scripts/tmp
|
sudo chmod -R g+ws `pwd`/app/files/scripts/tmp
|
||||||
sudo chown -R $USER:www-data `pwd`
|
sudo chown -R $USER:www-data `pwd`
|
||||||
|
|
||||||
# Resque perms
|
# Resque perms
|
||||||
sudo chown -R $USER:www-data `pwd`/app/Plugin/CakeResque/tmp
|
sudo chown -R $USER:www-data `pwd`/app/Plugin/CakeResque/tmp
|
||||||
sudo chmod -R 755 `pwd`/app/Plugin/CakeResque/tmp
|
sudo chmod -R 755 `pwd`/app/Plugin/CakeResque/tmp
|
||||||
|
|
||||||
# Fill database with basic MISP schema
|
# Fill database with basic MISP schema
|
||||||
mysql -h 127.0.0.1 --port 3306 -u root -pbar -e "SET GLOBAL sql_mode = 'STRICT_ALL_TABLES';"
|
mysql -h 127.0.0.1 --port 3306 -u root -pbar -e "SET GLOBAL sql_mode = 'STRICT_ALL_TABLES';"
|
||||||
mysql -h 127.0.0.1 --port 3306 -u root -pbar -e "grant usage on *.* to misp@'%' identified by 'blah';"
|
mysql -h 127.0.0.1 --port 3306 -u root -pbar -e "grant usage on *.* to misp@'%' identified by 'blah';"
|
||||||
mysql -h 127.0.0.1 --port 3306 -u root -pbar -e "grant all privileges on misp.* to misp@'%';"
|
mysql -h 127.0.0.1 --port 3306 -u root -pbar -e "grant all privileges on misp.* to misp@'%';"
|
||||||
mysql -h 127.0.0.1 --port 3306 -u misp -pblah misp < INSTALL/MYSQL.sql
|
mysql -h 127.0.0.1 --port 3306 -u misp -pblah misp < INSTALL/MYSQL.sql
|
||||||
|
|
||||||
# configure apache virtual hosts
|
# configure apache virtual hosts
|
||||||
sudo mkdir -p /etc/apache2/sites-available
|
sudo mkdir -p /etc/apache2/sites-available
|
||||||
sudo cp -f build/github-action-ci-apache /etc/apache2/sites-available/misp.conf
|
sudo cp -f build/github-action-ci-apache /etc/apache2/sites-available/misp.conf
|
||||||
|
@ -106,21 +106,21 @@ jobs:
|
||||||
cat /etc/apache2/sites-enabled/misp.conf
|
cat /etc/apache2/sites-enabled/misp.conf
|
||||||
sudo a2enmod rewrite
|
sudo a2enmod rewrite
|
||||||
sudo systemctl start --no-block apache2
|
sudo systemctl start --no-block apache2
|
||||||
|
|
||||||
# MISP configuration
|
# MISP configuration
|
||||||
sudo cp app/Config/bootstrap.default.php app/Config/bootstrap.php
|
sudo cp app/Config/bootstrap.default.php app/Config/bootstrap.php
|
||||||
sudo cp build/database.php app/Config/database.php
|
sudo cp build/database.php app/Config/database.php
|
||||||
sudo cp app/Config/core.default.php app/Config/core.php
|
sudo cp app/Config/core.default.php app/Config/core.php
|
||||||
sudo cp app/Config/config.default.php app/Config/config.php
|
sudo cp app/Config/config.default.php app/Config/config.php
|
||||||
sudo cp build/email.php app/Config/email.php
|
sudo cp build/email.php app/Config/email.php
|
||||||
|
|
||||||
# GPG setup
|
# GPG setup
|
||||||
sudo mkdir `pwd`/.gnupg
|
sudo mkdir `pwd`/.gnupg
|
||||||
# /!\ VERY INSECURE BUT FASTER ON THE BUILD ENV OF TRAVIS
|
# /!\ VERY INSECURE BUT FASTER ON THE BUILD ENV OF TRAVIS
|
||||||
sudo cp -a /dev/urandom /dev/random
|
sudo cp -a /dev/urandom /dev/random
|
||||||
sudo gpg --no-tty --no-permission-warning --pinentry-mode=loopback --passphrase "travistest" --homedir `pwd`/.gnupg --gen-key --batch `pwd`/build/gpg
|
sudo gpg --no-tty --no-permission-warning --pinentry-mode=loopback --passphrase "travistest" --homedir `pwd`/.gnupg --gen-key --batch `pwd`/build/gpg
|
||||||
sudo gpg --list-secret-keys --homedir `pwd`/.gnupg
|
sudo gpg --list-secret-keys --homedir `pwd`/.gnupg
|
||||||
|
|
||||||
# change perms
|
# change perms
|
||||||
sudo chown -R $USER:www-data `pwd`
|
sudo chown -R $USER:www-data `pwd`
|
||||||
sudo chown -R www-data:www-data `pwd`/.gnupg
|
sudo chown -R www-data:www-data `pwd`/.gnupg
|
||||||
|
@ -246,18 +246,18 @@ jobs:
|
||||||
pushd tests
|
pushd tests
|
||||||
./curl_tests_GH.sh $AUTH $HOST
|
./curl_tests_GH.sh $AUTH $HOST
|
||||||
popd
|
popd
|
||||||
|
|
||||||
sudo chmod -R g+ws `pwd`/app/tmp/logs
|
sudo chmod -R g+ws `pwd`/app/tmp/logs
|
||||||
|
|
||||||
. ./venv/bin/activate
|
. ./venv/bin/activate
|
||||||
pushd PyMISP
|
pushd PyMISP
|
||||||
cp tests/keys.py .
|
cp tests/keys.py .
|
||||||
python -m pytest -v --durations=0 tests/test_mispevent.py
|
python -m pytest -v --durations=0 tests/test_mispevent.py
|
||||||
python -m pytest -v --durations=0 tests/testlive_comprehensive.py
|
python -m pytest -v --durations=0 tests/testlive_comprehensive.py
|
||||||
popd
|
popd
|
||||||
python tests/testlive_security.py -v
|
|
||||||
python tests/testlive_sync.py
|
|
||||||
python tests/testlive_comprehensive_local.py -v
|
python tests/testlive_comprehensive_local.py -v
|
||||||
|
python tests/testlive_sync.py -v
|
||||||
|
python tests/testlive_security.py -v
|
||||||
cp PyMISP/tests/keys.py PyMISP/examples/events/
|
cp PyMISP/tests/keys.py PyMISP/examples/events/
|
||||||
pushd PyMISP/examples/events/
|
pushd PyMISP/examples/events/
|
||||||
python ./create_massive_dummy_events.py -l 5 -a 30
|
python ./create_massive_dummy_events.py -l 5 -a 30
|
||||||
|
@ -282,4 +282,4 @@ jobs:
|
||||||
- name: Errors in Logs
|
- name: Errors in Logs
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
./tests/logs_tests.sh
|
./tests/logs_tests.sh
|
||||||
|
|
|
@ -116,10 +116,10 @@ def send(api: PyMISP, request_type: str, url: str, data=None, check_errors: bool
|
||||||
if data is None:
|
if data is None:
|
||||||
data = {}
|
data = {}
|
||||||
response = api._prepare_request(request_type, url, data=data)
|
response = api._prepare_request(request_type, url, data=data)
|
||||||
r = response.json()
|
response = api._check_response(response)
|
||||||
if check_errors:
|
if check_errors:
|
||||||
check_response(r)
|
check_response(response)
|
||||||
return r
|
return response
|
||||||
|
|
||||||
|
|
||||||
def random() -> str:
|
def random() -> str:
|
||||||
|
|
Loading…
Reference in New Issue