File: test_afsegment.sh

package info (click to toggle)
afflib 3.7.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,584 kB
  • sloc: cpp: 20,911; ansic: 15,912; makefile: 520; sh: 436; python: 192
file content (27 lines) | stat: -rwxr-xr-x 688 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Test the afsegment command

# This file is a work of a US government employee and as such is in the Public domain.
# Simson L. Garfinkel, March 12, 2012

export PATH=$srcdir:../tools:../../tools:.:$PATH
BLANK_BASE=`mktemp -t blankXXXXX`
BLANK_RAW=$BLANK_BASE.raw
BLANK_AFF=$BLANK_BASE.aff
unset AFFLIB_PASSPHRASE

echo === Putting a new metadata segment into blank.aff  ===

/bin/rm -f $BLANK_AFF

cp /dev/null $BLANK_RAW
affcopy $BLANK_RAW $BLANK_AFF
affsegment -ssegname=testseg1 $BLANK_AFF
if [ x"testseg1" = x`affsegment -p segname $BLANK_AFF` ] ; then 
  echo affsegment worked!
else
  echo affsegment does not work properly
  exit 1
fi
/bin/rm -f $BLANK_RAW $BLANK_AFF