blob: f6eab4727267980919592ef8e4df299b3e2ab7fc [file] [log] [blame]
############################################################################
# Copyright (C) SchedMD LLC.
############################################################################
import atf
import pytest
import re
node_count = 9
# Setup
@pytest.fixture(scope="module", autouse=True)
def setup():
atf.require_nodes(node_count)
atf.require_slurm_running()
def test_test_only():
"""Test of slurm_job_will_run API, (srun --test-only option)."""
error_output = atf.run_command_error(
f"srun --test-only -O -N{node_count} printenv SLURMD_NODENAME"
)
assert (
re.search(r"Job \d+ to start at \d+", error_output) is not None
), "Failed out output job number or start time"