t_ciphers.sh revision 272343
1254721Semaste# $NetBSD: t_ciphers.sh,v 1.4 2012/07/14 16:04:06 spz Exp $
2254721Semaste#
3254721Semaste# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
4254721Semaste# All rights reserved.
5254721Semaste#
6254721Semaste# Redistribution and use in source and binary forms, with or without
7254721Semaste# modification, are permitted provided that the following conditions
8254721Semaste# are met:
9254721Semaste# 1. Redistributions of source code must retain the above copyright
10254721Semaste#    notice, this list of conditions and the following disclaimer.
11254721Semaste# 2. Redistributions in binary form must reproduce the above copyright
12254721Semaste#    notice, this list of conditions and the following disclaimer in the
13254721Semaste#    documentation and/or other materials provided with the distribution.
14254721Semaste#
15254721Semaste# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16254721Semaste# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17254721Semaste# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18254721Semaste# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19254721Semaste# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20254721Semaste# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21254721Semaste# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22254721Semaste# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23254721Semaste# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24254721Semaste# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25254721Semaste# POSSIBILITY OF SUCH DAMAGE.
26254721Semaste#
27254721Semaste
28254721Semasteatf_test_case bf
29254721Semastebf_head()
30254721Semaste{
31254721Semaste	atf_set "descr" "Checks blowfish cipher"
32254721Semaste}
33254721Semastebf_body()
34254721Semaste{
35254721Semaste	atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_bftest"
36254721Semaste}
37254721Semaste
38254721Semasteatf_test_case cast
39254721Semastecast_head()
40254721Semaste{
41254721Semaste	atf_set "descr" "Checks CAST cipher"
42254721Semaste	atf_set "timeout" "300"
43254721Semaste}
44254721Semastecast_body()
45254721Semaste{
46254721Semaste	atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_casttest"
47254721Semaste}
48254721Semaste
49254721Semasteatf_test_case des
50254721Semastedes_head()
51254721Semaste{
52254721Semaste	atf_set "descr" "Checks DES cipher (libdes)"
53254721Semaste}
54254721Semastedes_body()
55254721Semaste{
56254721Semaste	atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_destest"
57254721Semaste}
58254721Semaste
59254721Semasteatf_test_case evp
60254721Semasteevp_head()
61254721Semaste{
62254721Semaste	atf_set "descr" "Checks EVP cipher"
63254721Semaste}
64254721Semasteevp_body()
65254721Semaste{
66254721Semaste	atf_check -o ignore -e ignore $(atf_get_srcdir)/h_evp_test $(atf_get_srcdir)/evptests.txt
67254721Semaste}
68254721Semaste
69254721Semasteatf_test_case rc2
70254721Semasterc2_head()
71254721Semaste{
72254721Semaste	atf_set "descr" "Checks RC2 cipher"
73254721Semaste}
74254721Semasterc2_body()
75254721Semaste{
76254721Semaste	atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_rc2test"
77254721Semaste}
78254721Semaste
79254721Semasteatf_test_case rc4
80254721Semasterc4_head()
81254721Semaste{
82254721Semaste	atf_set "descr" "Checks RC4 cipher"
83254721Semaste}
84254721Semasterc4_body()
85254721Semaste{
86254721Semaste	atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_rc4test"
87254721Semaste}
88254721Semaste
89254721Semasteatf_test_case idea
90254721Semasteidea_head()
91254721Semaste{
92254721Semaste	atf_set "descr" "Checks IDEA cipher"
93254721Semaste}
94254721Semasteidea_body()
95254721Semaste{
96254721Semaste	atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_ideatest"
97254721Semaste}
98254721Semaste
99atf_test_case rc5
100rc5_head()
101{
102	atf_set "descr" "Checks RC5 cipher"
103}
104rc5_body()
105{
106	[ -x "$(atf_get_srcdir)/h_rc5test" ] \
107	    || atf_skip "RC5 support not available; system built" \
108	                "with MKCRYPTO_RC5=no"
109	atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_rc5test"
110}
111
112atf_init_test_cases()
113{
114	atf_add_test_case bf
115	atf_add_test_case cast
116	atf_add_test_case des
117	atf_add_test_case evp
118	atf_add_test_case rc2
119	atf_add_test_case rc4
120	atf_add_test_case idea
121	atf_add_test_case rc5
122}
123