summaryrefslogtreecommitdiff
path: root/tests/accel-cmd/test_cmd_basic.py
blob: c6cdc7ae5be0b20ac8a96001568857ac0d8f10ad (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
import pytest
from common import process


def test_accel_cmd_version(accel_cmd):
    (exit, out, err) = process.run([accel_cmd, "--version"])

    # test that accel-cmd --version exits with code 0, prints
    # nothing to stdout and prints to stdout
    assert exit == 0 and err == "" and "accel-cmd " in out and len(out.split(" ")) == 2


def test_accel_cmd_non_existent_host(accel_cmd):
    (exit, out, err) = process.run([accel_cmd, "-Hnon-existent-host", "--verbose"])

    # test that accel-cmd (tried to connecto to non-existent host) exits with code != 0,
    # prints nothing to stdout and prints an error to stderr
    assert exit != 0 and out == "" and err != ""


def test_accel_cmd_mcast_host(accel_cmd):
    (exit, out, err) = process.run([accel_cmd, "-H225.0.0.1"])

    # test that accel-cmd (tried to connecto to mcast host) exits with code != 0,
    # prints nothing to stdout and prints an error to stderr
    assert exit != 0 and out == "" and err != ""