xref: /freebsd/libexec/nuageinit/tests/utils.sh (revision 13da1af1cd677b7901d3bf4b9dbe3290b94130d5)
1#-
2# Copyright (c) 2022 Baptiste Daroussin <bapt@FreeBSD.org>
3#
4# SPDX-License-Identifier: BSD-2-Clause
5#
6
7atf_test_case warn
8atf_test_case err
9atf_test_case dirname
10
11warn_body()
12{
13	atf_check -e "inline:nuageinit: plop\n" -s exit:0 /usr/libexec/flua $(atf_get_srcdir)/warn.lua
14}
15
16err_body()
17{
18	atf_check -e "inline:nuageinit: plop\n" -s exit:1 /usr/libexec/flua $(atf_get_srcdir)/err.lua
19}
20
21dirname_body()
22{
23	atf_check -o "inline:/my/path/\n" -s exit:0 /usr/libexec/flua $(atf_get_srcdir)/dirname.lua
24}
25
26atf_init_test_cases()
27{
28	atf_add_test_case warn
29	atf_add_test_case err
30	atf_add_test_case dirname
31}
32