Revert "ci: skip "lib/test-fork-safe-execvpe.sh" on Alpine Linux"
[libnbd.git] / copy / copy-zero-to-nbd.sh
blob620aece73c69fe29dc9eee89b91742a73ca92b37
1 #!/usr/bin/env bash
2 # nbd client library in userspace
3 # Copyright Red Hat
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 . ../tests/functions.sh
21 set -e
22 set -x
24 requires nbdkit --exit-with-parent --version
26 pidfile=copy-zero-to-nbd.pid
27 sock=$(mktemp -u /tmp/libnbd-test-copy.XXXXXX)
28 cleanup_fn rm -f $pidfile $sock
30 nbdkit --exit-with-parent -f -v -P $pidfile -U $sock memory size=10M &
31 # Wait for the pidfile to appear.
32 for i in {1..60}; do
33 if test -f $pidfile; then
34 break
36 sleep 1
37 done
38 if ! test -f $pidfile; then
39 echo "$0: nbdkit did not start up"
40 exit 1
43 $VG nbdcopy -p /dev/null "nbd+unix:///?socket=$sock"