xref: /netbsd-src/tests/usr.bin/vmstat/t_vmstat.sh (revision bf613d334239dc669c9330f8a8b4e87340b0068f)
1*bf613d33Sjruoho# $NetBSD: t_vmstat.sh,v 1.2 2020/06/25 11:12:03 jruoho Exp $
226125ae7Sgson#
326125ae7Sgson# Copyright (c) 2013 The NetBSD Foundation, Inc.
426125ae7Sgson# All rights reserved.
526125ae7Sgson#
626125ae7Sgson# Redistribution and use in source and binary forms, with or without
726125ae7Sgson# modification, are permitted provided that the following conditions
826125ae7Sgson# are met:
926125ae7Sgson# 1. Redistributions of source code must retain the above copyright
1026125ae7Sgson#    notice, this list of conditions and the following disclaimer.
1126125ae7Sgson# 2. Redistributions in binary form must reproduce the above copyright
1226125ae7Sgson#    notice, this list of conditions and the following disclaimer in the
1326125ae7Sgson#    documentation and/or other materials provided with the distribution.
1426125ae7Sgson#
1526125ae7Sgson# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1626125ae7Sgson# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1726125ae7Sgson# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1826125ae7Sgson# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
1926125ae7Sgson# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2026125ae7Sgson# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2126125ae7Sgson# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2226125ae7Sgson# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2326125ae7Sgson# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2426125ae7Sgson# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2526125ae7Sgson# POSSIBILITY OF SUCH DAMAGE.
2626125ae7Sgson#
2726125ae7Sgson
2826125ae7Sgsonatf_test_case default
2926125ae7Sgsondefault_head() {
30*bf613d33Sjruoho	atf_set "descr" "Test that vmstat(1) returns " \
31*bf613d33Sjruoho		"success when run with no arguments"
3226125ae7Sgson}
3326125ae7Sgsondefault_body() {
3426125ae7Sgson	atf_check -s exit:0 -o ignore -e empty vmstat
3526125ae7Sgson}
3626125ae7Sgson
3726125ae7Sgsonatf_test_case opt_s
3826125ae7Sgsonopt_s_head() {
39*bf613d33Sjruoho	atf_set "descr" "Test that vmstat(1) returns " \
40*bf613d33Sjruoho		"success when run with -s (PR bin/44518)"
4126125ae7Sgson}
4226125ae7Sgsonopt_s_body() {
4326125ae7Sgson	atf_check -s exit:0 -o ignore -e empty vmstat -s
4426125ae7Sgson}
4526125ae7Sgson
4626125ae7Sgsonatf_init_test_cases()
4726125ae7Sgson{
4826125ae7Sgson	atf_add_test_case default
4926125ae7Sgson	atf_add_test_case opt_s
5026125ae7Sgson}
51