3 #test jack_property client
7 # -a running jack server
13 #uninstall jack, setup jack1, make sure /dev/shm/ is clean, start jackd -ddummy in new terminal, run this script in new terminal
14 # time ./jack_property_test.sh > /tmp/jack_property_test_jack1_out.txt 2>&1
16 #uninstall jack, setup jack2, make sure /dev/shm/ is clean, start jackd -ddummy in new terminal, run this script in new terminal
17 # time ./jack_property_test.sh > /tmp/jack_property_test_jack2_out.txt 2>&1
19 #for stress test: while true; do ./jack_property_test.sh; sleep 1; done
20 #to inspect running script: start with bash -x ./jack_property_test.sh
24 #any failed test will set this to 1 (error)
53 function expect_ok_empty
()
62 echo "test ${TESTPREFIX}$1: $2"
65 #test using -c, --client
66 function client_test
()
70 cmd
="jack_property -D"
74 expect
"$res" "JACK metadata successfully deleted"
76 cmd
="jack_property -l"
79 expect_ok_empty $?
"$res"
81 cmd
="jack_property -c -l $client"
84 expect_ok_empty $?
"$res"
86 cmd
="jack_property -c -s $client client_key client_value"
89 expect_ok_empty $?
"$res"
91 cmd
="jack_property -c -l $client"
95 expect
"$res" "key: client_key value: client_value"
97 cmd
="jack_property -c -l $client client_key"
101 expect
"$res" "client_value"
103 cmd
="jack_property -l" # |tail -1"
105 res
="`$cmd 2>&1 |tail -1`"
106 #18446744073709551615
107 #key: client_key value: client_value
109 expect
"$res" "key: client_key value: client_value"
111 cmd
="jack_property -p -l ${client}:non"
115 expect
"$res" "cannot find port name ${client}:non"
118 #test using -p, --port
123 cmd
="jack_property -D"
127 expect
"$res" "JACK metadata successfully deleted"
129 cmd
="jack_property -l"
132 expect_ok_empty $?
"$res"
134 cmd
="jack_property -p -l $port"
137 expect_ok_empty $?
"$res"
139 cmd
="jack_property -p -s $port port_key port_value"
142 expect_ok_empty $?
"$res"
144 cmd
="jack_property -p -l $port"
148 expect
"$res" "key: port_key value: port_value"
150 cmd
="jack_property -p -l $port port_key"
154 expect
"$res" "port_value"
156 cmd
="jack_property -p -d $port port_key"
159 expect_ok_empty $?
"$res"
161 cmd
="jack_property -p -l $port port_key"
165 expect
"$res" "Value not found for port_key of $port"
167 cmd
="jack_property -p -d $port port_key"
169 res
="`$cmd 2>&1 |tail -1`"
170 #Cannot delete key port_key (BDB0073 DB_NOTFOUND: No matching key/data pair found)
171 #"port_key" property not removed for system:playback_1
173 expect
"$res" "\"port_key\" property not removed for $port"
175 cmd
="jack_property -p -l $port"
178 expect_ok_empty $?
"$res"
180 cmd
="jack_property -p -l $port non"
184 expect
"$res" "Value not found for non of $port"
186 cmd
="jack_property -c -l non"
190 expect
"$res" "cannot get UUID for client named non"
196 port_test system
:playback_1
198 #test with any jack client
208 port_test metro
:120_bpm
211 #JACK metadata successfully deleted
216 echo "done, exit status is $FINAL_RETURN_VALUE"
219 #test short keys, values
220 #test long keys, values
223 exit $FINAL_RETURN_VALUE