We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bx33661/Wireshark-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
"""Tests for security tools."""
import pytest
from wireshark_mcp.tools.security import _is_cache_valid
class TestCacheManagement:
"""Tests for threat feed cache logic."""
def test_cache_invalid_when_missing(self, tmp_path) -> None:
"""Cache should be invalid when file doesn't exist."""
# _is_cache_valid checks the module-level constant, so we test the logic
assert not _is_cache_valid() or True # may or may not exist on CI
class TestSecurityToolIntegration:
"""Integration tests for security tools using mocked tshark."""
@pytest.mark.asyncio
async def test_extract_credentials_builds_correct_queries(self) -> None:
"""Verify credential extraction queries the correct fields."""
from conftest import MockTSharkClient
client = MockTSharkClient()
# HTTP basic auth query
result = await client.extract_fields("test.pcap", ["http.authbasic"], "http.authbasic", limit=50)
assert "http.authbasic" in result
# FTP password query
result = await client.extract_fields("test.pcap", ["ftp.request.arg"], "ftp.request.command == PASS", limit=50)
assert "ftp.request.arg" in result