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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. $@ &> test/test-04.out
  45. check test/test-04 "Test multiple configuration commands"
  46. grep -v ^videohub: < test/test-03.out > test/test-05.out
  47. sed -e 's,| L |,| O |,g' < test/test-01.ok > test/test-05.ok
  48. check test/test-05 "Test if --backup restored correct config."
  49. ./videohubctrl --test-input test/input-00.txt --vi-name 0 "Test Input 0" $@ &> test/test-06.out
  50. ./videohubctrl --test-input test/input-00.txt --vi-name 18 "Test Input 18" $@ &>> test/test-06.out
  51. ./videohubctrl --test-input test/input-00.txt --vi-name "Input 18" "Test Input 18" $@ &>> test/test-06.out
  52. ./videohubctrl --test-input test/input-00.txt --vo-name 18 "Test Output 18" $@ &>> test/test-06.out
  53. ./videohubctrl --test-input test/input-00.txt --vo-name "Output 18" "Test Output 18" $@ &>> test/test-06.out
  54. ./videohubctrl --test-input test/input-00.txt --vo-lock 18 $@ &>> test/test-06.out
  55. ./videohubctrl --test-input test/input-00.txt --vo-lock "Output 18" $@ &>> test/test-06.out
  56. ./videohubctrl --test-input test/input-00.txt --vo-unlock 18 $@ &>> test/test-06.out
  57. ./videohubctrl --test-input test/input-00.txt --vo-unlock "Output 18" $@ &>> test/test-06.out
  58. ./videohubctrl --test-input test/input-00.txt --vo-input 0 0 $@ &>> test/test-06.out
  59. ./videohubctrl --test-input test/input-00.txt --vo-input 0 18 $@ &>> test/test-06.out
  60. ./videohubctrl --test-input test/input-00.txt --vo-input 18 0 $@ &>> test/test-06.out
  61. ./videohubctrl --test-input test/input-00.txt --vo-input 18 18 $@ &>> test/test-06.out
  62. ./videohubctrl --test-input test/input-00.txt --vo-input 1 18 $@ &>> test/test-06.out
  63. ./videohubctrl --test-input test/input-00.txt --vo-input 18 1 $@ &>> test/test-06.out
  64. ./videohubctrl --test-input test/input-00.txt --vo-input "Input 10" "Output 10" $@ &>> test/test-06.out
  65. ./videohubctrl --test-input test/input-00.txt --vo-input "Err Output" "Input 10" $@ &>> test/test-06.out
  66. ./videohubctrl --test-input test/input-00.txt --vo-input "Output 10" "Err Input" $@ &>> test/test-06.out
  67. ./videohubctrl --test-input test/input-00.txt --mo-name 18 "Test Output 18" $@ &>> test/test-06.out
  68. ./videohubctrl --test-input test/input-00.txt --mo-name "Output 18" "Test Output 18" $@ &>> test/test-06.out
  69. ./videohubctrl --test-input test/input-00.txt --mo-lock 18 $@ &>> test/test-06.out
  70. ./videohubctrl --test-input test/input-00.txt --mo-lock "Output 18" $@ &>> test/test-06.out
  71. ./videohubctrl --test-input test/input-00.txt --mo-unlock 18 $@ &>> test/test-06.out
  72. ./videohubctrl --test-input test/input-00.txt --mo-unlock "Output 18" $@ &>> test/test-06.out
  73. check test/test-06 "Test errors on commands with invalid ports."
  74. videohubctrl --test-input test/input-00.txt --list-device $@ &> test/test-07.out
  75. check test/test-07 "Test --list-device option output"
  76. videohubctrl --test-input test/input-00.txt --list-vinputs $@ &> test/test-08.out
  77. check test/test-08 "Test --list-vinputs option output"
  78. videohubctrl --test-input test/input-00.txt --list-voutputs $@ &> test/test-09.out
  79. check test/test-09 "Test --list-voutputs option output"
  80. videohubctrl --test-input test/input-10.txt $@ &> test/test-10.out
  81. check test/test-10 "Test invalid protocol"
  82. videohubctrl --test-input test/input-11.txt $@ &> test/test-11.out
  83. check test/test-11 "Test invalid number of ports"
  84. videohubctrl --test-input test/input-12.txt $@ &> test/test-12.out
  85. check test/test-12 "Test device-not_present check"
  86. videohubctrl --test-input test/input-14.txt $@ &> test/test-14.out
  87. check test/test-14 "Test buggy input"
  88. videohubctrl --test-input test/input-00.txt --list-moutputs $@ &> test/test-15.out
  89. check test/test-15 "Test --list-moutputs option output"