|
| 1 | +#** ***************************************************************************** |
| 2 | +# * |
| 3 | +# * If not stated otherwise in this file or this component's LICENSE file the |
| 4 | +# * following copyright and licenses apply: |
| 5 | +# * |
| 6 | +# * Copyright 2024 RDK Management |
| 7 | +# * |
| 8 | +# * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | +# * you may not use this file except in compliance with the License. |
| 10 | +# * You may obtain a copy of the License at |
| 11 | +# * |
| 12 | +# * |
| 13 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | +# * |
| 15 | +# * Unless required by applicable law or agreed to in writing, software |
| 16 | +# * distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | +# * See the License for the specific language governing permissions and |
| 19 | +# * limitations under the License. |
| 20 | +# * |
| 21 | +#* ****************************************************************************** |
| 22 | + |
| 23 | +# Curl command for activating FrontPanel plugin |
| 24 | +activate_command = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc":"2.0","id":"3" |
| 25 | +,"method": "Controller.1.activate", "params":{"callsign":"org.rdk.FrontPanel"}}' http://127.0.0.1:55555/jsonrpc''' |
| 26 | + |
| 27 | +# Curl command for deactivating FrontPanel plugin |
| 28 | +deactivate_command = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc":"2.0","id":"3" |
| 29 | +,"method": "Controller.1.deactivate", "params":{"callsign":"org.rdk.FrontPanel"}}' http://127.0.0.1:55555/jsonrpc''' |
| 30 | + |
| 31 | +# Store the expected output response for activate & deactivate curl command |
| 32 | +expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}' |
| 33 | + |
| 34 | +###################################################################################### |
| 35 | + |
| 36 | +# FrontPanel Methods : |
| 37 | + |
| 38 | +get_brightness = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 39 | +"method":"org.rdk.FrontPanel.getBrightness","params": {"index": "power_led"}}' http://127.0.0.1:55555/jsonrpc''' |
| 40 | + |
| 41 | +get_brightness_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 42 | +"method":"org.rdk.FrontPanel.getBrightness","params": {"index": "invalid_string"}}' http://127.0.0.1:55555/jsonrpc''' |
| 43 | + |
| 44 | +get_clock_brightness = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", |
| 45 | +"id": 42,"method":"org.rdk.FrontPanel.getClockBrightness"}' http://127.0.0.1:55555/jsonrpc''' |
| 46 | + |
| 47 | +get_frontpanel_leds = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 48 | +"method":"org.rdk.FrontPanel.getFrontPanelLights"}' http://127.0.0.1:55555/jsonrpc''' |
| 49 | + |
| 50 | +get_preferences_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42, |
| 51 | +"method":"org.rdk.FrontPanel.getPreferences","params": {"vendorid": "0x4455"}}' http://127.0.0.1:55555/jsonrpc''' |
| 52 | + |
| 53 | +get_preferences = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 54 | +"method":"org.rdk.FrontPanel.getPreferences"}' http://127.0.0.1:55555/jsonrpc''' |
| 55 | + |
| 56 | +is_24_hour_clock = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 57 | +"method":"org.rdk.FrontPanel.is24HourClock"}' http://127.0.0.1:55555/jsonrpc''' |
| 58 | + |
| 59 | +power_led_off = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42, |
| 60 | +"method":"org.rdk.FrontPanel.powerLedOff","params": {"index": power_led}}' http://127.0.0.1:55555/jsonrpc''' |
| 61 | + |
| 62 | +power_led_on = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42, |
| 63 | +"method":"org.rdk.FrontPanel.powerLedOn","params": {"index": power_led}}' http://127.0.0.1:55555/jsonrpc''' |
| 64 | + |
| 65 | +power_led_on_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42, |
| 66 | +"method":"org.rdk.FrontPanel.powerLedOn","params": {"index": invalid_led}}' http://127.0.0.1:55555/jsonrpc''' |
| 67 | + |
| 68 | +set_24_hour_clock = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 69 | +"method":"org.rdk.FrontPanel.set24HourClock", "params": {"is24Hour": false}}' http://127.0.0.1:55555/jsonrpc''' |
| 70 | + |
| 71 | +set_24_hour_clock_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 72 | +"method":"org.rdk.FrontPanel.set24HourClock", "params": {"is24Hour": 1234}}' http://127.0.0.1:55555/jsonrpc''' |
| 73 | + |
| 74 | + |
| 75 | +set_color_blink = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 76 | +"method":"org.rdk.FrontPanel.setBlink", "params": {"blinkInfo": { |
| 77 | + "ledIndicator": "power_led", |
| 78 | + "iterations": 10, |
| 79 | + "pattern": [ |
| 80 | + { |
| 81 | + "brightness": 50, |
| 82 | + "duration": 100, |
| 83 | + "color": "red", |
| 84 | + "red": 0, |
| 85 | + "green": 0, |
| 86 | + "blue": 0 |
| 87 | + } |
| 88 | + ] |
| 89 | + } |
| 90 | + }}' http://127.0.0.1:55555/jsonrpc''' |
| 91 | + |
| 92 | + |
| 93 | +set_color_blink_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 94 | +"method":"org.rdk.FrontPanel.setBlink", "params": {"blinkInfo": { |
| 95 | + "ledIndicator": "power_led", |
| 96 | + "iterations": 10, |
| 97 | + "pattern": [ |
| 98 | + { |
| 99 | + "brightness": 0X77, |
| 100 | + "duration": "invalid", |
| 101 | + "color": "black", |
| 102 | + "red": 9876, |
| 103 | + "green": "ABCD", |
| 104 | + "blue": 0 |
| 105 | + } |
| 106 | + ] |
| 107 | + } |
| 108 | + }}' http://127.0.0.1:55555/jsonrpc''' |
| 109 | + |
| 110 | +set_brightness = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 111 | +"method":"org.rdk.FrontPanel.setBrightness", "params": {"brightness": 50,"index": "power_led"}}' http://127.0.0.1:55555/jsonrpc''' |
| 112 | + |
| 113 | +set_brightness_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 114 | +"method":"org.rdk.FrontPanel.setBrightness", "params": {"brightness": "ABCD","index": "power_led"}}' http://127.0.0.1:55555/jsonrpc''' |
| 115 | + |
| 116 | +set_clock_brightness = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 117 | +"method":"org.rdk.FrontPanel.setClockBrightness", "params": {"brightness": 50}}' http://127.0.0.1:55555/jsonrpc''' |
| 118 | +set_clock_test_pattern = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 119 | +"method":"org.rdk.FrontPanel.setClockTestPattern", "params": {"show": true,"timeInterval": 4}}' http://127.0.0.1:55555/jsonrpc''' |
| 120 | + |
| 121 | +set_led = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 122 | +"method":"org.rdk.FrontPanel.setLED", "params": {"ledIndicator": "power_led", |
| 123 | + "brightness": 50, |
| 124 | + "color": "red", |
| 125 | + "red": 0, |
| 126 | + "green": 0, |
| 127 | + "blue": 0 |
| 128 | + }}' http://127.0.0.1:55555/jsonrpc''' |
| 129 | + |
| 130 | + |
| 131 | +set_led_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 132 | +"method":"org.rdk.FrontPanel.setLED", "params": {"ledIndicator": "power_led", |
| 133 | + "brightness": 999999999, |
| 134 | + "color": "no_colour", |
| 135 | + "red": "invalid_string", |
| 136 | + "green": 0, |
| 137 | + "blue": 0 |
| 138 | + }}' http://127.0.0.1:55555/jsonrpc''' |
| 139 | +set_preferences = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 140 | +"method":"org.rdk.FrontPanel.setPreferences", "params": {"preferences": {}}}' http://127.0.0.1:55555/jsonrpc''' |
| 141 | + |
| 142 | +set_preferences_invalid = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 143 | +"method":"org.rdk.FrontPanel.setPreferences", "params": {"preferences": {1234}}}' http://127.0.0.1:55555/jsonrpc''' |
| 144 | + |
| 145 | +#All the curl commands which has params dependency for hitting without parameters are given here |
| 146 | +set_brightness_withoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 147 | +"method":"org.rdk.FrontPanel.setBrightness"}' http://127.0.0.1:55555/jsonrpc''' |
| 148 | +get_brightness_withoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 149 | +"method":"org.rdk.FrontPanel.getBrightness"}' http://127.0.0.1:55555/jsonrpc''' |
| 150 | +set_powerLedOff_withoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 151 | +"method":"org.rdk.FrontPanel.powerLedOff"}' http://127.0.0.1:55555/jsonrpc''' |
| 152 | +set_powerLedOn_withoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 153 | +"method":"org.rdk.FrontPanel.powerLedOn"}' http://127.0.0.1:55555/jsonrpc''' |
| 154 | +set_24HourClockWithoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 155 | +"method":"org.rdk.FrontPanel.set24HourClock"}' http://127.0.0.1:55555/jsonrpc''' |
| 156 | +set_blinkWithoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 157 | +"method":"org.rdk.FrontPanel.setBlink"}' http://127.0.0.1:55555/jsonrpc''' |
| 158 | +set_clockBrightnesswithoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 159 | +"method":"org.rdk.FrontPanel.setClockTestPattern"}' http://127.0.0.1:55555/jsonrpc''' |
| 160 | +set_ledWithoutParams = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 161 | +"method":"org.rdk.FrontPanel.setLED"}' http://127.0.0.1:55555/jsonrpc''' |
| 162 | +set_preferencesWithoutParams ='''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42, |
| 163 | +"method":"org.rdk.FrontPanel.setPreferences"}' http://127.0.0.1:55555/jsonrpc''' |
0 commit comments