1320703Sngie#!/bin/sh 2320703Sngie# 3320703Sngie# Copyright (c) 2017 Ngie Cooper <ngie@FreeBSD.org> 4320703Sngie# All rights reserved. 5320703Sngie# 6320703Sngie# Redistribution and use in source and binary forms, with or without 7320703Sngie# modification, are permitted provided that the following conditions 8320703Sngie# are met: 9320703Sngie# 1. Redistributions of source code must retain the above copyright 10320703Sngie# notice, this list of conditions and the following disclaimer. 11320703Sngie# 2. Redistributions in binary form must reproduce the above copyright 12320703Sngie# notice, this list of conditions and the following disclaimer in the 13320703Sngie# documentation and/or other materials provided with the distribution. 14320703Sngie# 15320703Sngie# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16320703Sngie# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17320703Sngie# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18320703Sngie# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19320703Sngie# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20320703Sngie# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21320703Sngie# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22320703Sngie# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23320703Sngie# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24320703Sngie# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25320703Sngie# SUCH DAMAGE. 26320703Sngie# 27320703Sngie# $FreeBSD: stable/10/share/zoneinfo/tests/zoneinfo_common.sh 320703 2017-07-06 04:30:06Z ngie $ 28320703Sngie 29320703SngieZONEINFO_DIR=/usr/share/zoneinfo 30320703Sngie 31320703Sngieverify_Links() 32320703Sngie{ 33320703Sngie local zoneinfo_file 34320703Sngie 35320703Sngie zoneinfo_file=$1 36320703Sngie 37320703Sngie awk '$1 == "Link" && NF == 3 { print $2, $3; }' < $zoneinfo_file | \ 38320703Sngie while read src dest; do 39320703Sngie verify_Link $src $dest 40320703Sngie done 41320703Sngie} 42320703Sngie 43320703Sngieverify_Link() 44320703Sngie{ 45320703Sngie local src dest 46320703Sngie 47320703Sngie old_path=$ZONEINFO_DIR/$src 48320703Sngie new_path=$ZONEINFO_DIR/$dest 49320703Sngie 50320703Sngie atf_check test -f $new_path 51320703Sngie atf_check test -f $old_path 52320703Sngie 53320703Sngie atf_check cmp $old_path $new_path 54320703Sngie} 55