Home | History | Annotate | Line # | Download | only in librumpclient
t_exec.sh revision 1.6.2.2
      1  1.6.2.2  bouyer #       $NetBSD: t_exec.sh,v 1.6.2.2 2011/02/17 12:00:54 bouyer Exp $
      2  1.6.2.2  bouyer #
      3  1.6.2.2  bouyer # Copyright (c) 2011 The NetBSD Foundation, Inc.
      4  1.6.2.2  bouyer # All rights reserved.
      5  1.6.2.2  bouyer #
      6  1.6.2.2  bouyer # Redistribution and use in source and binary forms, with or without
      7  1.6.2.2  bouyer # modification, are permitted provided that the following conditions
      8  1.6.2.2  bouyer # are met:
      9  1.6.2.2  bouyer # 1. Redistributions of source code must retain the above copyright
     10  1.6.2.2  bouyer #    notice, this list of conditions and the following disclaimer.
     11  1.6.2.2  bouyer # 2. Redistributions in binary form must reproduce the above copyright
     12  1.6.2.2  bouyer #    notice, this list of conditions and the following disclaimer in the
     13  1.6.2.2  bouyer #    documentation and/or other materials provided with the distribution.
     14  1.6.2.2  bouyer #
     15  1.6.2.2  bouyer # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     16  1.6.2.2  bouyer # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     17  1.6.2.2  bouyer # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     18  1.6.2.2  bouyer # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     19  1.6.2.2  bouyer # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     20  1.6.2.2  bouyer # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     21  1.6.2.2  bouyer # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     22  1.6.2.2  bouyer # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     23  1.6.2.2  bouyer # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     24  1.6.2.2  bouyer # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     25  1.6.2.2  bouyer # POSSIBILITY OF SUCH DAMAGE.
     26  1.6.2.2  bouyer #
     27  1.6.2.2  bouyer 
     28  1.6.2.2  bouyer rumpsrv='rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet'
     29  1.6.2.2  bouyer export RUMP_SERVER=unix://csock
     30  1.6.2.2  bouyer export RUMPHIJACK_RETRYCONNECT='die'
     31  1.6.2.2  bouyer 
     32  1.6.2.2  bouyer atf_test_case noexec cleanup
     33  1.6.2.2  bouyer noexec_head()
     34  1.6.2.2  bouyer {
     35  1.6.2.2  bouyer         atf_set "descr" "check that we see what we expect without exec"
     36  1.6.2.2  bouyer }
     37  1.6.2.2  bouyer 
     38  1.6.2.2  bouyer noexec_body()
     39  1.6.2.2  bouyer {
     40  1.6.2.2  bouyer 
     41  1.6.2.2  bouyer 	atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
     42  1.6.2.2  bouyer 	atf_check -s exit:0 env $(atf_get_srcdir)/h_exec
     43  1.6.2.2  bouyer 	atf_check -s exit:0 -o save:sstat.out rump.sockstat
     44  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*h_exec.*tcp.*\*\.1234' \
     45  1.6.2.2  bouyer 	    sed -n 2p sstat.out
     46  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*h_exec.*tcp.*\*\.2345' \
     47  1.6.2.2  bouyer 	    sed -n 3p sstat.out
     48  1.6.2.2  bouyer }
     49  1.6.2.2  bouyer 
     50  1.6.2.2  bouyer noexec_cleanup()
     51  1.6.2.2  bouyer {
     52  1.6.2.2  bouyer 	rump.halt
     53  1.6.2.2  bouyer }
     54  1.6.2.2  bouyer 
     55  1.6.2.2  bouyer atf_test_case exec cleanup
     56  1.6.2.2  bouyer exec_head()
     57  1.6.2.2  bouyer {
     58  1.6.2.2  bouyer         atf_set "descr" "check that client names changes after exec"
     59  1.6.2.2  bouyer }
     60  1.6.2.2  bouyer 
     61  1.6.2.2  bouyer exec_body()
     62  1.6.2.2  bouyer {
     63  1.6.2.2  bouyer 
     64  1.6.2.2  bouyer 	atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
     65  1.6.2.2  bouyer 	atf_check -s exit:0 $(atf_get_srcdir)/h_exec $(atf_get_srcdir)/h_exec
     66  1.6.2.2  bouyer 	atf_check -s exit:0 -o save:sstat.out rump.sockstat
     67  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.1234' \
     68  1.6.2.2  bouyer 	    sed -n 2p sstat.out
     69  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.2345' \
     70  1.6.2.2  bouyer 	    sed -n 3p sstat.out
     71  1.6.2.2  bouyer }
     72  1.6.2.2  bouyer 
     73  1.6.2.2  bouyer exec_cleanup()
     74  1.6.2.2  bouyer {
     75  1.6.2.2  bouyer 	rump.halt
     76  1.6.2.2  bouyer }
     77  1.6.2.2  bouyer 
     78  1.6.2.2  bouyer atf_test_case cloexec cleanup
     79  1.6.2.2  bouyer cloexec_head()
     80  1.6.2.2  bouyer {
     81  1.6.2.2  bouyer         atf_set "descr" "check that FD_CLOEXEC works"
     82  1.6.2.2  bouyer }
     83  1.6.2.2  bouyer 
     84  1.6.2.2  bouyer cloexec_body()
     85  1.6.2.2  bouyer {
     86  1.6.2.2  bouyer 
     87  1.6.2.2  bouyer 	atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
     88  1.6.2.2  bouyer 	atf_check -s exit:0  \
     89  1.6.2.2  bouyer 	    $(atf_get_srcdir)/h_exec $(atf_get_srcdir)/h_exec cloexec1
     90  1.6.2.2  bouyer 	atf_check -s exit:0 -o save:sstat.out rump.sockstat
     91  1.6.2.2  bouyer 	atf_check -s exit:0 -o inline:'2\n' sed -n '$=' sstat.out
     92  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.2345' \
     93  1.6.2.2  bouyer 	    sed -n 2p sstat.out
     94  1.6.2.2  bouyer }
     95  1.6.2.2  bouyer 
     96  1.6.2.2  bouyer cloexec_cleanup()
     97  1.6.2.2  bouyer {
     98  1.6.2.2  bouyer 	rump.halt
     99  1.6.2.2  bouyer }
    100  1.6.2.2  bouyer 
    101  1.6.2.2  bouyer atf_test_case vfork cleanup
    102  1.6.2.2  bouyer vfork_head()
    103  1.6.2.2  bouyer {
    104  1.6.2.2  bouyer         atf_set "descr" "test rumpclient_vfork()"
    105  1.6.2.2  bouyer }
    106  1.6.2.2  bouyer 
    107  1.6.2.2  bouyer vfork_body()
    108  1.6.2.2  bouyer {
    109  1.6.2.2  bouyer 
    110  1.6.2.2  bouyer 	atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
    111  1.6.2.2  bouyer 	atf_check -s exit:0  \
    112  1.6.2.2  bouyer 	    $(atf_get_srcdir)/h_exec $(atf_get_srcdir)/h_exec vfork_please
    113  1.6.2.2  bouyer 	atf_check -s exit:0 -o save:sstat.out rump.sockstat
    114  1.6.2.2  bouyer 	atf_check -s exit:0 -o inline:'5\n' sed -n '$=' sstat.out
    115  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.1234' \
    116  1.6.2.2  bouyer 	    cat sstat.out
    117  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*h_ution.*tcp.*\*\.2345' \
    118  1.6.2.2  bouyer 	    cat sstat.out
    119  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*fourchette.*tcp.*\*\.1234' \
    120  1.6.2.2  bouyer 	    cat sstat.out
    121  1.6.2.2  bouyer 	atf_check -s exit:0 -o match:'^root.*fourchette.*tcp.*\*\.2345' \
    122  1.6.2.2  bouyer 	    cat sstat.out
    123  1.6.2.2  bouyer }
    124  1.6.2.2  bouyer 
    125  1.6.2.2  bouyer vfork_cleanup()
    126  1.6.2.2  bouyer {
    127  1.6.2.2  bouyer 	rump.halt
    128  1.6.2.2  bouyer }
    129  1.6.2.2  bouyer 
    130  1.6.2.2  bouyer 
    131  1.6.2.2  bouyer atf_init_test_cases()
    132  1.6.2.2  bouyer {
    133  1.6.2.2  bouyer 	atf_add_test_case noexec
    134  1.6.2.2  bouyer 	atf_add_test_case exec
    135  1.6.2.2  bouyer 	atf_add_test_case cloexec
    136  1.6.2.2  bouyer 	atf_add_test_case vfork
    137  1.6.2.2  bouyer }
    138