from boefjes.plugins.kat_cve_2024_6387.normalize import is_vulnerable


def test_is_vulnerable():
    for version in [
        "SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u3",
        "SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u10",
        "SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.3",
        "SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.4",
        "SSH-2.0-OpenSSH_9.3p1 Ubuntu-1ubuntu3.6",
        "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.10",
    ]:
        assert not is_vulnerable(version)

    for version in [
        "SSH-2.0-OpenSSH_8.9p1",
        "SSH-2.0-OpenSSH_9.2p1",
        "SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u2",
        "SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13",
        "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.7",
        "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3",
    ]:
        assert is_vulnerable(version)
