bstinson / centos / t_functional

Forked from centos/t_functional 4 years ago
Clone

Blame tests/p_findutils/20-xargs_tests

Christoph Galuschka d0b941
#!/bin/bash
Christoph Galuschka d0b941
echo "Running $0"
Christoph Galuschka d0b941
TMPDIR=/var/tmp/find
Christoph Galuschka d0b941
# Basic xargs tests
Christoph Galuschka d0b941
Christoph Galuschka d0b941
echo "Basic xargs tests"
Christoph Galuschka d0b941
find "$TMPDIR" -type f -print0  | xargs  -0 ls &>/dev/null 
Christoph Galuschka d0b941
#ls  -l >/dev/null
Christoph Galuschka d0b941
t_CheckExitStatus $?
Christoph Galuschka d0b941
Christoph Galuschka d0b941
echo "Check xargs fails when filenames with spaces are passed in"
Christoph Galuschka d0b941
find "$TMPDIR" -type f | xargs ls &>/dev/null  && { t_Log "FAIL: This test returned 0 status incorrectly"; exit $FAIL; }
Christoph Galuschka d0b941
t_Log "PASS"
Christoph Galuschka d0b941
Christoph Galuschka d0b941
Christoph Galuschka d0b941
# Cleanup
Christoph Galuschka d0b941
[[ -d "$TMPDIR" ]] && rm -rf "$TMPDIR"