Skip to content

Commit 2353053

Browse files
committed
multiple-pipeline.sh: add new -f(irst) option to make it generic
multiple-pipeline-capture.sh is now multiple-pipeline.sh -f c Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent 552de8f commit 2353053

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

test-case/multiple-pipeline-capture.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -e
55
TESTDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
66

77
# Need "exec" otherwise it believes to be a Sub-Test
8-
exec "$TESTDIR"/test-case/multiple-pipeline.sh "$@"
8+
exec "$TESTDIR"/test-case/multiple-pipeline.sh -f c "$@"

test-case/multiple-pipeline.sh

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
#!/bin/bash
22

3-
### WARNING: this file is 99% COPY/PASTE from multiple-pipeline-playback.sh! ###
4-
53
##
6-
## Case Name: Run multiple pipelines for capture
4+
## Case Name: Run multiple pipelines for playback or capture
75
## Preconditions:
8-
## check-capture-10sec pass
6+
## check-playback-10sec or check-capture-10sec pass
97
## Description:
108
## Pick up pipelines from TPLG file for max count
119
## Rule:
1210
## a. fill pipeline need match max count
13-
## b. fill pipeline type order: capture > playback
11+
## b. Start filling either playback or capture depending on -f parameter
1412
## c. if pipeline in TPLG is not enough of count, max count is pipeline count
1513
## Case step:
1614
## 1. Parse TPLG file to get pipeline count to decide max count is parameter or pipeline count
17-
## 2. load capture for arecord to fill pipeline count
18-
## 3. load playback for aplay fill pipeline count
15+
## 2/3. load capture for arecord to fill pipeline count
16+
## 2/3. load playback for aplay fill pipeline count
1917
## 4. wait for 0.5s for process already loaded
2018
## 5. check process status & process count
2119
## 6. wait for sleep time
@@ -35,6 +33,10 @@ OPT_PARM_lst['t']=1 OPT_VALUE_lst['t']="$TPLG"
3533
OPT_OPT_lst['c']='count' OPT_DESC_lst['c']='test pipeline count'
3634
OPT_PARM_lst['c']=1 OPT_VALUE_lst['c']=4
3735

36+
OPT_OPT_lst['f']='first'
37+
OPT_DESC_lst['f']='Fill either playback (p) or capture (c) first'
38+
OPT_PARM_lst['f']=1 OPT_VALUE_lst['f']='p'
39+
3840
OPT_OPT_lst['w']='wait' OPT_DESC_lst['w']='perpare wait time by sleep'
3941
OPT_PARM_lst['w']=1 OPT_VALUE_lst['w']=5
4042

@@ -112,8 +114,19 @@ do
112114
dlogi "===== Testing: (Loop: $i/$loop_cnt) ====="
113115

114116
# start capture:
115-
func_run_pipeline_with_type "capture"
116-
func_run_pipeline_with_type "playback"
117+
f_arg=${OPT_VALUE_lst['f']}
118+
case "$f_arg" in
119+
'p')
120+
func_run_pipeline_with_type "playback"
121+
func_run_pipeline_with_type "capture"
122+
;;
123+
'c')
124+
func_run_pipeline_with_type "capture"
125+
func_run_pipeline_with_type "playback"
126+
;;
127+
*)
128+
die "Wrong -f argument $f_arg, see -h"
129+
esac
117130

118131
dlogi "pipeline start sleep 0.5s for device wakeup"
119132
sleep ${OPT_VALUE_lst['w']}

0 commit comments

Comments
 (0)