diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-10-07 12:13:54 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-10-07 14:05:56 +0200 |
commit | 4a06c7a391a930153111ad602b21daa756c5f7c9 (patch) | |
tree | 190dbf974e37de7b24f2241f47d2b716e8354ca0 /tests | |
parent | 5b1efd0b533be974c165548eaa749cba480d060b (diff) |
#915 Update run-tests.py to the latest changes
This handles changes in:
- The host of the DB.
- New json config file.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/config/ogserver.json | 20 | ||||
-rwxr-xr-x | tests/run-tests.py | 6 |
2 files changed, 23 insertions, 3 deletions
diff --git a/tests/config/ogserver.json b/tests/config/ogserver.json new file mode 100644 index 0000000..d152195 --- /dev/null +++ b/tests/config/ogserver.json @@ -0,0 +1,20 @@ +{ + "rest" : { + "ip" : "127.0.0.1", + "port" : "8888", + "api_token": "07b3bfe728954619b58f0107ad73acc1" + }, + "database" : { + "ip": "127.0.0.1", + "port": 3306, + "name" : "test-db", + "user" : "test-db", + "pass" : "test-db" + }, + "repository" : { + "directory": "/opt/opengnsys/images" + }, + "wol" : { + "interface" : "lo" + } +} diff --git a/tests/run-tests.py b/tests/run-tests.py index 11becc0..17f6c64 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -4,9 +4,9 @@ import subprocess, glob, os sql_data = "INSERT INTO aulas (nombreaula, idcentro, urlfoto, grupoid, ubicacion, puestos, modomul, ipmul, pormul, velmul, router, netmask, ntp, dns, proxy, modp2p, timep2p) VALUES ('Aula virtual', 1, 'aula.jpg', 0, 'Despliegue virtual con Vagrant.', 5, 2, '239.194.2.11', 9000, 70, '192.168.56.1', '255.255.255.0', '', '', '', 'peer', 30); INSERT INTO ordenadores (nombreordenador, ip, mac, idaula, idrepositorio, idperfilhard, idmenu, idproautoexec, grupoid, router, mascara, arranque, netiface, netdriver, fotoord) VALUES ('pc2', '192.168.2.1', '0800270E6501', 1, 1, 0, 0, 0, 0, '192.168.56.1', '255.255.255.0', '00unknown', 'eth0', 'generic', 'fotoordenador.gif'), ('pc2', '192.168.2.2', '0800270E6502', 1, 1, 0, 0, 0, 0, '192.168.56.1', '255.255.255.0', '00unknown', 'eth0', 'generic', 'fotoordenador.gif');" -sql_create_user = "CREATE USER 'test-db'@'hostname'; GRANT ALL PRIVILEGES ON *.* To 'test-db'@'hostname' IDENTIFIED BY 'test-db';" +sql_create_user = "CREATE USER 'test-db'@'localhost'; GRANT ALL PRIVILEGES ON *.* To 'test-db'@'localhost' IDENTIFIED BY 'test-db';" -sql_delete_user = "DROP USER 'test-db'@'hostname';" +sql_delete_user = "DROP USER 'test-db'@'localhost';" def start_mysql(): @@ -32,7 +32,7 @@ if os.path.isfile('../ogserver') is not True: start_mysql(); -subprocess.Popen(['../ogserver', '-f', 'config/ogserver.cfg']) +subprocess.Popen(['../ogserver -f config/ogserver.json'], shell=True) subprocess.run('python3 -m unittest discover -s units -v', shell=True) |