videohubctrl can be used to control Blackmagic Design Videohub SDI router device over the network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

run 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #!/bin/sh
  2. # Simple test suite for videohubctrl functionality
  3. cd $(dirname $0)/..
  4. export PATH=".:$PATH"
  5. make
  6. ulimit -c unlimited
  7. export PATH=".:$PATH"
  8. check() {
  9. if diff -u $1.ok $1.out
  10. then
  11. echo "OK : $2"
  12. else
  13. echo "ERROR : $2"
  14. exit 1
  15. fi
  16. }
  17. videohubctrl --test-input test/input-00.txt $@ &> test/test-01.out
  18. check test/test-01 "Test parsing of test/input-00.txt"
  19. videohubctrl --test-input test/input-00.txt --backup $@ &> test/test-02.out
  20. check test/test-02 "Test --backup option output"
  21. (
  22. sed -e 's|\\||g' < test/test-02.ok | tr -d '\n'
  23. echo ' --test-input test/input-03.txt'
  24. ) | sh &> test/test-03.out
  25. check test/test-03 "Test --backup restore"
  26. videohubctrl --test-input test/input-00.txt \
  27. --set-name "Test name" \
  28. --in-name "Windows 4 HD" "Windows 4 HighDef" \
  29. --in-output "Windows 1" "Output 15" \
  30. --in-monitor "Windows 3" "Monitor 1" \
  31. --in-name 5 "In 5" \
  32. --in-name "Input 6" "Camera 6" \
  33. --out-name "Enc1 1" "Encoder 1" \
  34. --out-name 16 Dev-Lo \
  35. --out-lock 6 \
  36. --out-lock "Output 15" \
  37. --out-unlock 12 \
  38. --out-unlock "Enc2 1" \
  39. --out-input "Output 5" "Windows 1" \
  40. --out-input 5 2 \
  41. --out-input 5 "Windows 3" \
  42. --mon-name 1 "PC 1 Mon" \
  43. --mon-name "Monitor 4" "Decklink" \
  44. --mon-unlock 2 \
  45. --mon-lock 4 \
  46. --mon-name 3 "Loopback" \
  47. --mon-input 3 16 \
  48. --ser-name 1 "Ren Ctrl 1" \
  49. --ser-name "Deck 3" "Ren Deck 3" \
  50. --ser-unlock 1 \
  51. --ser-lock 2 \
  52. --ser-input 2 1 \
  53. --ser-dir 6 in \
  54. --ser-dir 7 out \
  55. --ser-dir 8 out --ser-dir 8 auto \
  56. --ser-input 4 5 \
  57. --ser-input 6 7 \
  58. --ser-clear 4 \
  59. --ser-clear "Serial 6" \
  60. --pu-clear 1 --pu-clear 3 --pu-clear 4 \
  61. --pu-unlock 1 --pu-lock 1 --pu-connect 1 "Windows 4 HD" \
  62. --pu-connect 4 "DPlay1" --pu-lock 4 \
  63. --fr-name 1 "Pic 1" --fr-name 2 "Pic 2" \
  64. --fr-output 1 13 --fr-output 2 14 --fr-output 3 15 \
  65. --fr-clear 3 \
  66. --fr-lock 1 --fr-lock 2 --fr-lock 8 --fr-unlock 8 \
  67. $@ &> test/test-04.out
  68. check test/test-04 "Test multiple configuration commands"
  69. grep -v ^videohub: < test/test-03.out > test/test-05.out
  70. sed -e 's,| L |,| O |,g' < test/test-01.ok > test/test-05.ok
  71. check test/test-05 "Test if --backup restored correct config."
  72. videohubctrl --test-input test/input-00.txt --in-name 0 "Test Input 0" $@ &> test/test-06.out
  73. videohubctrl --test-input test/input-00.txt --in-name 18 "Test Input 18" $@ >> test/test-06.out 2>&1
  74. videohubctrl --test-input test/input-00.txt --in-name "Input 18" "Test Input 18" $@ >> test/test-06.out 2>&1
  75. videohubctrl --test-input test/input-00.txt --out-name 18 "Test Output 18" $@ >> test/test-06.out 2>&1
  76. videohubctrl --test-input test/input-00.txt --out-name "Output 18" "Test Output 18" $@ >> test/test-06.out 2>&1
  77. videohubctrl --test-input test/input-00.txt --in-output "Input 22" "Output 15" $@ >> test/test-06.out 2>&1
  78. videohubctrl --test-input test/input-00.txt --in-output "Input 14" "Output 22" $@ >> test/test-06.out 2>&1
  79. videohubctrl --test-input test/input-00.txt --in-monitor "Input 22" "Monitor 3" $@ >> test/test-06.out 2>&1
  80. videohubctrl --test-input test/input-00.txt --in-monitor "Input 14" "Monitor 33" $@ >> test/test-06.out 2>&1
  81. videohubctrl --test-input test/input-00.txt --out-lock 18 $@ >> test/test-06.out 2>&1
  82. videohubctrl --test-input test/input-00.txt --out-lock "Output 18" $@ >> test/test-06.out 2>&1
  83. videohubctrl --test-input test/input-00.txt --out-unlock 18 $@ >> test/test-06.out 2>&1
  84. videohubctrl --test-input test/input-00.txt --out-unlock "Output 18" $@ >> test/test-06.out 2>&1
  85. videohubctrl --test-input test/input-00.txt --out-input 0 0 $@ >> test/test-06.out 2>&1
  86. videohubctrl --test-input test/input-00.txt --out-input 0 18 $@ >> test/test-06.out 2>&1
  87. videohubctrl --test-input test/input-00.txt --out-input 18 0 $@ >> test/test-06.out 2>&1
  88. videohubctrl --test-input test/input-00.txt --out-input 18 18 $@ >> test/test-06.out 2>&1
  89. videohubctrl --test-input test/input-00.txt --out-input 1 18 $@ >> test/test-06.out 2>&1
  90. videohubctrl --test-input test/input-00.txt --out-input 18 1 $@ >> test/test-06.out 2>&1
  91. videohubctrl --test-input test/input-00.txt --out-input "Input 10" "Output 10" $@ >> test/test-06.out 2>&1
  92. videohubctrl --test-input test/input-00.txt --out-input "Err Output" "Input 10" $@ >> test/test-06.out 2>&1
  93. videohubctrl --test-input test/input-00.txt --out-input "Output 10" "Err Input" $@ >> test/test-06.out 2>&1
  94. videohubctrl --test-input test/input-00.txt --mon-name 18 "Test Output 18" $@ >> test/test-06.out 2>&1
  95. videohubctrl --test-input test/input-00.txt --mon-name "Output 18" "Test Output 18" $@ >> test/test-06.out 2>&1
  96. videohubctrl --test-input test/input-00.txt --mon-lock 18 $@ >> test/test-06.out 2>&1
  97. videohubctrl --test-input test/input-00.txt --mon-lock "Output 18" $@ >> test/test-06.out 2>&1
  98. videohubctrl --test-input test/input-00.txt --mon-unlock 18 $@ >> test/test-06.out 2>&1
  99. videohubctrl --test-input test/input-00.txt --mon-unlock "Output 18" $@ >> test/test-06.out 2>&1
  100. videohubctrl --test-input test/input-00.txt --ser-name 18 "Test Serial 18" $@ >> test/test-06.out 2>&1
  101. videohubctrl --test-input test/input-00.txt --ser-name "Serial 18" "Test Serial 18" $@ >> test/test-06.out 2>&1
  102. videohubctrl --test-input test/input-00.txt --ser-clear 24 $@ >> test/test-06.out 2>&1
  103. videohubctrl --test-input test/input-00.txt --ser-clear "Serial X" $@ >> test/test-06.out 2>&1
  104. videohubctrl --test-input test/input-00.txt --ser-connect 24 7 $@ >> test/test-06.out 2>&1
  105. videohubctrl --test-input test/input-00.txt --ser-lock 18 $@ >> test/test-06.out 2>&1
  106. videohubctrl --test-input test/input-00.txt --ser-lock "Serial 18" $@ >> test/test-06.out 2>&1
  107. videohubctrl --test-input test/input-00.txt --ser-unlock 18 $@ >> test/test-06.out 2>&1
  108. videohubctrl --test-input test/input-00.txt --ser-unlock "Serial 18" $@ >> test/test-06.out 2>&1
  109. videohubctrl --test-input test/input-00.txt --ser-dir 1 err-dir $@ >> test/test-06.out 2>&1
  110. videohubctrl --test-input test/input-00.txt --ser-dir "Serial 5" err-dir $@ >> test/test-06.out 2>&1
  111. videohubctrl --test-input test/input-00.txt --set-name $@ >> test/test-06.out 2>&1
  112. check test/test-06 "Test errors on commands with invalid parameters."
  113. videohubctrl --test-input test/input-00.txt --list-device $@ &> test/test-07.out
  114. check test/test-07 "Test --list-device option output"
  115. videohubctrl --test-input test/input-00.txt --list-inputs $@ &> test/test-08.out
  116. check test/test-08 "Test --list-inputs option output"
  117. videohubctrl --test-input test/input-00.txt --list-outputs $@ &> test/test-09.out
  118. check test/test-09 "Test --list-outputs option output"
  119. videohubctrl --test-input test/input-10.txt $@ &> test/test-10.out
  120. check test/test-10 "Test invalid protocol"
  121. videohubctrl --test-input test/input-11.txt $@ &> test/test-11.out
  122. check test/test-11 "Test invalid number of ports"
  123. videohubctrl --test-input test/input-12.txt $@ &> test/test-12.out
  124. check test/test-12 "Test device-not_present check"
  125. videohubctrl --test-input test/input-14.txt $@ &> test/test-14.out
  126. check test/test-14 "Test buggy input"
  127. videohubctrl --test-input test/input-00.txt --list-monitor $@ &> test/test-15.out
  128. check test/test-15 "Test --list-monitor option output"
  129. videohubctrl --test-input test/input-00.txt --list-serial $@ &> test/test-16.out
  130. check test/test-16 "Test --list-serial option output"
  131. videohubctrl --test-input test/input-17.txt --info $@ &> test/test-17.out
  132. check test/test-17 "Test wider range of input commands"
  133. videohubctrl --test-input test/input-00.txt --list-proc-units $@ &> test/test-18.out
  134. check test/test-18 "Test --list-proc-units option output"
  135. videohubctrl --test-input test/input-00.txt --list-frames $@ &> test/test-19.out
  136. check test/test-19 "Test --list-frames option output"
  137. videohubctrl --test-input test/input-r.txt $@ &> test/test-r.out
  138. check test/test-r "Test input with windows line endings"
  139. videohubctrl --test-input test/input-r2.txt $@ &> test/test-r2.out
  140. check test/test-r2 "Test input with leading whitespace and windows line endings"
  141. videohubctrl --test-input test/input-288.txt $@ &> test/test-288.out
  142. check test/test-288 "Test videohub 288 config parsing"
  143. videohubctrl --list-alarms --test-input test/input-288-alarms.txt $@ &> test/test-288-alarms.out
  144. check test/test-288-alarms "Test alarm overflow"