Skip to content

Commit 755b47d

Browse files
author
Nestor Monroy
committed
feat: update webpack and test database
1 parent 22cecdf commit 755b47d

5 files changed

Lines changed: 520 additions & 106 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,9 @@ infrastructure/vagrant/*.box
268268

269269
.init_completed
270270
/infrastructure/state/
271+
package-lock.json
272+
verify_connections_071124.txt
273+
verify_connections_0711251238.txt
274+
verify_connections_07112251250.txt
275+
verify_connections_0711251239.txt
276+
verify_connections_0711251240.txt
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env python3
2+
import socket
3+
import platform
4+
import subprocess
5+
import mysql.connector
6+
import psycopg2
7+
8+
# Configuración
9+
MARIADB_PORT = 13306
10+
POSTGRES_PORT = 15432
11+
MARIADB_USER = "django_user"
12+
MARIADB_PASS = "django_pass"
13+
MARIADB_DB = "ivr_legacy"
14+
POSTGRES_USER = "django_user"
15+
POSTGRES_PASS = "django_pass"
16+
POSTGRES_DB = "iact_analytics"
17+
18+
def check_port(host, port):
19+
try:
20+
with socket.create_connection((host, port), timeout=2):
21+
return "[ESCUCHANDO]"
22+
except Exception:
23+
return "[NO DISPONIBLE]"
24+
25+
def check_ping(host):
26+
try:
27+
output = subprocess.check_output(f"ping -n 1 {host}", shell=True, text=True)
28+
return "[OK]" if "TTL=" in output else "[FALLO]"
29+
except Exception:
30+
return "[FALLO]"
31+
32+
def check_mysql(user, password, db=None, port=3306):
33+
try:
34+
conn = mysql.connector.connect(user=user, password=password, host="127.0.0.1", port=port, database=db)
35+
conn.close()
36+
return "[OK]"
37+
except Exception as e:
38+
return f"[FALLO] {str(e).splitlines()[0]}"
39+
40+
def check_postgres(user, password, db=None, port=5432):
41+
try:
42+
conn = psycopg2.connect(user=user, password=password, host="127.0.0.1", port=port, dbname=db)
43+
conn.close()
44+
return "[OK]"
45+
except Exception as e:
46+
return f"[FALLO] {str(e).splitlines()[0]}"
47+
48+
def section(title):
49+
print("\n" + "="*66)
50+
print(title)
51+
print("="*66)
52+
53+
def main():
54+
section("VERIFICACION DE PUERTOS Y CONEXIONES DESDE HOST WINDOWS")
55+
56+
section("1. INFORMACION DEL SISTEMA")
57+
print(f"Hostname: {platform.node()}")
58+
print(f"Sistema: {platform.platform()}")
59+
print(f"Arquitectura: {platform.machine()}")
60+
61+
section("2. CONECTIVIDAD BASICA")
62+
print("Loopback (127.0.0.1):", check_ping("127.0.0.1"))
63+
print("Gateway por defecto (10.0.2.2):", check_ping("10.0.2.2"))
64+
print("Internet (8.8.8.8):", check_ping("8.8.8.8"))
65+
66+
section("3. PUERTOS REDIRECCIONADOS HACIA VM")
67+
print(f"MariaDB puerto {MARIADB_PORT}:", check_port("127.0.0.1", MARIADB_PORT))
68+
print(f"PostgreSQL puerto {POSTGRES_PORT}:", check_port("127.0.0.1", POSTGRES_PORT))
69+
70+
section("4. PRUEBAS DE CONEXION A BASES DE DATOS EN VM")
71+
print(f"MariaDB ({MARIADB_USER}):", check_mysql(MARIADB_USER, MARIADB_PASS, db=MARIADB_DB, port=MARIADB_PORT))
72+
print(f"PostgreSQL ({POSTGRES_USER}):", check_postgres(POSTGRES_USER, POSTGRES_PASS, db=POSTGRES_DB, port=POSTGRES_PORT))
73+
74+
section("5. RESOLUCION DNS")
75+
print("Resolucion DNS (google.com):", check_ping("google.com"))
76+
77+
if __name__ == "__main__":
78+
main()

api/callcentersite/requirements/test.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,8 @@ pytest-html>=4.1.1
5858
# ============================================
5959
# ENVIRONMENT
6060
# ============================================
61-
python-dotenv>=1.0.0
61+
python-dotenv>=1.0.0
62+
63+
mysql-connector-python
64+
psycopg2-binary
65+
psutil

0 commit comments

Comments
 (0)