summaryrefslogtreecommitdiffstats
path: root/tools/fuzzing/smoke/test_grizzly.py
blob: 2c8f406222c738ec38e1145d5a1a258a6905692a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
import os.path
import sys
from subprocess import check_call

import mozunit
import pytest
from moztest.selftest import fixtures

MOZ_AUTOMATION = bool(os.getenv("MOZ_AUTOMATION", "0") == "1")


def test_grizzly_smoke():
    ffbin = fixtures.binary()

    if MOZ_AUTOMATION:
        assert os.path.exists(
            ffbin
        ), "Missing Firefox build. Build it, or set GECKO_BINARY_PATH"

    elif not os.path.exists(ffbin):
        pytest.skip("Missing Firefox build. Build it, or set GECKO_BINARY_PATH")

    check_call(
        [
            sys.executable,
            "-m",
            "grizzly",
            ffbin,
            "no-op",
            "--headless",
            "--smoke-test",
            "--limit",
            "10",
            "--relaunch",
            "5",
        ],
    )


if __name__ == "__main__":
    mozunit.main()