#!/bin/sh

set -eu

cd "$AUTOPKGTEST_TMP"

echo $(sara cve --version 6.49.6) > output.txt
cat output.txt

for cve in CVE-2026-86060 CVE-2022-45315; do
    if ! grep -qF "$cve" output.txt; then
        echo "FAIL: $cve affects RouterOS 6.49.6 but was not reported"
        exit 1
    fi
done
for cve in CVE-0000-0002 CVE-0000-0003; do
    if grep -qF "$cve" output.txt; then
        echo "FAIL: $cve does not affect RouterOS 6.49.6 but was reported"
        exit 1
    fi
done
