components/libpki/files/setup_test.sh
changeset 5897 495a9e2444e4
child 6257 cdf29f584705
equal deleted inserted replaced
5896:f6a52b8a207c 5897:495a9e2444e4
       
     1 #!/bin/sh
       
     2 #
       
     3 # CDDL HEADER START
       
     4 #
       
     5 # The contents of this file are subject to the terms of the
       
     6 # Common Development and Distribution License (the "License").
       
     7 # You may not use this file except in compliance with the License.
       
     8 #
       
     9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
    10 # or http://www.opensolaris.org/os/licensing.
       
    11 # See the License for the specific language governing permissions
       
    12 # and limitations under the License.
       
    13 #
       
    14 # When distributing Covered Code, include this CDDL HEADER in each
       
    15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    16 # If applicable, add the following below this CDDL HEADER, with the
       
    17 # fields enclosed by brackets "[]" replaced with your own identifying
       
    18 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    19 #
       
    20 # CDDL HEADER END
       
    21 #
       
    22 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
       
    23 #
       
    24 
       
    25 BUILD_DIR=$1
       
    26 COMPONENT_SRC=$2
       
    27 
       
    28 export PATH=/bin:$PATH
       
    29 
       
    30 # Replace the path to that under component build dir
       
    31 gsed -i.orig 's|\"etc\"|'\""$BUILD_DIR"'/etc\"|g' $COMPONENT_SRC/src/tests/test6.c
       
    32 rm $COMPONENT_SRC/src/tests/test6.c.orig
       
    33 gsed -i.orig 's|\"etc\"|'\""$BUILD_DIR"'/etc\"|g' $COMPONENT_SRC/src/tests/test8.c
       
    34 rm $COMPONENT_SRC/src/tests/test8.c.orig
       
    35 
       
    36 # Make dirs under component build dir and copy necessary files under them
       
    37 rm -rf $BUILD_DIR/etc/hsm.d
       
    38 mkdir $BUILD_DIR/etc/hsm.d
       
    39 cp $COMPONENT_SRC/etc/hsm.d/etoken-engine.xml $BUILD_DIR/etc/hsm.d
       
    40 rm $BUILD_DIR/etc/objectIdentifiers.xml
       
    41 cp $COMPONENT_SRC/etc/objectIdentifiers.xml $BUILD_DIR/etc
       
    42 rm -rf $BUILD_DIR/etc/token.d
       
    43 mkdir $BUILD_DIR/etc/token.d
       
    44 cp $COMPONENT_SRC/etc/token.d/test.xml $BUILD_DIR/etc/token.d
       
    45 
       
    46 # Replace the path to that under component build dir
       
    47 sed -e 's|/$HOME|'"$BUILD_DIR"'/etc|g' $COMPONENT_SRC/etc/token.d/default.xml > $BUILD_DIR/etc/token.d/default.xml
       
    48 
       
    49 # Copy .libpki dir under component build dir
       
    50 rm -rf $BUILD_DIR/etc/.libpki
       
    51 cp -R $COMPONENT_SRC/etc/.libpki $BUILD_DIR/etc
       
    52 
       
    53 # Make results dir under component build dir
       
    54 rm -rf $BUILD_DIR/results
       
    55 mkdir $BUILD_DIR/results