Home | History | Annotate | Line # | Download | only in system
      1 #!/bin/sh
      2 #
      3 # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      4 #
      5 # SPDX-License-Identifier: MPL-2.0
      6 #
      7 # This Source Code Form is subject to the terms of the Mozilla Public
      8 # License, v. 2.0. If a copy of the MPL was not distributed with this
      9 # file, you can obtain one at https://mozilla.org/MPL/2.0/.
     10 #
     11 # See the COPYRIGHT file distributed with this work for additional
     12 # information regarding copyright ownership.
     13 
     14 #
     15 # Run a single system test using the pytest runner. This is a simple wrapper
     16 # around pytest for convenience.
     17 #
     18 
     19 if [ -z "$1" ] || [ ! -d "$1" ]; then
     20   echo "Usage: $0 system_test_dir [pytest_args]"
     21   exit 2
     22 fi
     23 
     24 system_test_dir="$1"
     25 system_test="$(basename $system_test_dir)"
     26 shift
     27 
     28 (
     29   [ -d "$system_test_dir" ] || exit 2
     30   cd "${system_test_dir}/.."
     31   /usr/bin/env python3 -m pytest "$@" "$system_test"
     32 )
     33