Commit be0f0e0b authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests - Tools - SIMAP AI Engine:

- Fixed paths
- Minor code fixes
parent 7df750cf
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -26,10 +26,9 @@ PROJECTDIR=`pwd`

cd $PROJECTDIR/src

export PYTHONPATH=$PROJECTDIR/src
export PYTHONPATH=$PROJECTDIR/src:$PROJECTDIR/src/tests/tools/simap_ai_engine

# Run the mocked integration test (no external dependencies)
python3 -m pytest --verbose \
    --log-cli-level=DEBUG -v -s \
    tests/mwc26-f5ga/AI_analytics_engine/tests/test_api.py
    tests/tools/simap_ai_engine/ai_engine/tests/test_api.py

src/tests/mwc26-f5ga/destroy.sh

deleted100755 → 0
+0 −9
Original line number Diff line number Diff line

echo "Cleaning up..."
docker rm --force simap-server
docker rm --force nce-fan-ctrl
docker rm --force nce-t-ctrl
docker rm --force ai-engine
docker rm --force traffic-changer
sleep 2
docker ps -a
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ Provides AI/ML processing functionality for SLA analysis.
"""

import logging
from datetime import datetime, UTC
from datetime import datetime, timezone
from random import Random
from typing import Any, Dict, Optional

@@ -161,6 +161,6 @@ class AIModelProcessor:
            'confidence_scores': score,  
            'summary': {
            'sla_policy': sla_policy.to_dict(),
            'timestamp': datetime.now(UTC).isoformat()
            'timestamp': datetime.now(timezone.utc).isoformat()
            }
        }
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ Defines the REST API endpoints for the AI Engine.
"""

import logging
from datetime import datetime, UTC
from datetime import datetime, timezone


from flask import Blueprint, jsonify, request
@@ -171,7 +171,7 @@ def create_ai_engine_blueprint(
        return jsonify({
            'status': 'healthy',
            'service': 'AI Engine',
            'timestamp': datetime.now(UTC).isoformat()
            'timestamp': datetime.now(timezone.utc).isoformat()
        }), 200

    @blueprint.route('/config', methods=['GET'])
+9 −6
Original line number Diff line number Diff line
@@ -29,15 +29,18 @@ import time
import pytest
import requests

# Add TFS src directory to path for 'common' module
# Must be done before any imports from the AI Analytics Engine
# Add TFS src directory and AI Engine package root to path.
# Must be done before any package imports.
current_dir = os.path.dirname(os.path.abspath(__file__))
tfs_src_dir = os.path.abspath(os.path.join(current_dir, '../../../..'))
tfs_src_dir = os.path.abspath(os.path.join(current_dir, '../../../../..'))
ai_engine_root_dir = os.path.abspath(os.path.join(current_dir, '../..'))
if tfs_src_dir not in sys.path:
    sys.path.insert(0, tfs_src_dir)
if ai_engine_root_dir not in sys.path:
    sys.path.insert(0, ai_engine_root_dir)

# Now we can import from the AI Analytics Engine package
from AI_analytics_engine import AIAnalyticsEngineAPI
# Now we can import from the AI Engine package
from ai_engine import AIEngineAPI

# Configure logging for tests
logging.basicConfig(
@@ -67,7 +70,7 @@ def ai_engine_server():
    os.environ['AI_ENGINE_REST_PORT'] = str(TEST_PORT)
    
    # Create engine instance
    engine = AIAnalyticsEngineAPI()
    engine = AIEngineAPI()
    
    # Start server in background thread
    server_thread = threading.Thread(
Loading