blob: faaad1ffe101192f253d5e3a7ea7c591dac80d5c [file] [log] [blame]
Felix Janda63e042c2012-12-27 17:55:21 +01001#!/bin/bash
2
3[ -f testing.sh ] && . testing.sh
4
5#testing "name" "command" "result" "infile" "stdin"
6
7testing "mkfifo" "mkfifo one && [ -p one ] && echo yes" "yes\n" "" ""
8rm one
9
10touch existing
Rob Landley336c44a2016-03-02 15:20:04 -060011testing "existing" \
Felix Janda63e042c2012-12-27 17:55:21 +010012 "mkfifo existing 2> /dev/null || [ -f existing ] && echo yes" "yes\n" "" ""
13rm existing
14
Rob Landley336c44a2016-03-02 15:20:04 -060015testing "one two" \
Felix Janda63e042c2012-12-27 17:55:21 +010016 "mkfifo one two && [ -p one ] && [ -p two ] && echo yes" "yes\n" "" ""
17rm one two
18
19umask 123
Rob Landley336c44a2016-03-02 15:20:04 -060020testing "(default permissions)" \
Felix Janda63e042c2012-12-27 17:55:21 +010021 "mkfifo one && stat -c %a one" "644\n" "" ""
22rm one
23
24umask 000
25
Rob Landley336c44a2016-03-02 15:20:04 -060026testing "-m 124" \
Felix Janda63e042c2012-12-27 17:55:21 +010027 "mkfifo -m 124 one && stat -c %a one" "124\n" "" ""
28rm -f one