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 6.8KB

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