@@ -40,6 +40,10 @@ complete_command() {
4040 fi
4141}
4242
43+ is_pi4 () {
44+ grep -qE ' ^Model.* Raspberry Pi 4' /proc/cpuinfo
45+ }
46+
4347@test " vcgencmd - -> -t -h --help" {
4448 complete_command " vcgencmd -"
4549 [[ " ${COMPREPLY[*]} " == " -t -h --help" ]]
@@ -108,11 +112,31 @@ complete_command() {
108112 [[ " ${COMPREPLY[*]} " == " 0 1" ]]
109113}
110114
115+ # Pi 4B has two hdmi pixel freq limits 0 and 1, Pi 2 and 3 just have one
111116@test " get_config hdmi_pixel_freq_li -> hdmi_pixel_freq_limit:0" {
117+ if is_pi4; then
118+ skip " test only valid with 1 hdmi (earlier pi models)"
119+ fi
112120 complete_command " vcgencmd get_config hdmi_pixel_freq_li"
113121 [[ " ${COMPREPLY[*]} " == " hdmi_pixel_freq_limit:0" ]]
114122}
115123
124+ @test " get_config hdmi_pixel_freq_li -> hdmi_pixel_freq_limit:" {
125+ if ! is_pi4; then
126+ skip " test requires Pi 4 with 2 hdmi outputs"
127+ fi
128+ complete_command " vcgencmd get_config hdmi_pixel_freq_li"
129+ [[ " ${COMPREPLY[*]} " == " hdmi_pixel_freq_limit:0 hdmi_pixel_freq_limit:1" ]]
130+ }
131+
132+ @test " get_config hdmi_pixel_freq_limit: -> 0 1" {
133+ if ! is_pi4; then
134+ skip " test requires Pi 4 with 2 hdmi outputs"
135+ fi
136+ complete_command " vcgencmd get_config hdmi_pixel_freq_limit:"
137+ [[ " ${COMPREPLY[*]} " == " 0 1" ]]
138+ }
139+
116140@test " vcos -> version log" {
117141 complete_command " vcgencmd vcos "
118142 echo " ${COMPREPLY[*]} " | grep -Ewo " (version|log)"
@@ -168,3 +192,8 @@ complete_command() {
168192 complete_command " vcgencmd -t vcos log "
169193 [[ " ${COMPREPLY[*]} " == " status" ]]
170194}
195+
196+ @test " vcos 0 -> (nothing)" {
197+ complete_command " vcgencmd vcos 0 "
198+ [[ " ${# COMPREPLY[@]} " -eq 0 ]]
199+ }
0 commit comments