├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── canedge_manager.py ├── canedge_manager_cli.py ├── config ├── config_func_00_06_XX_00_07_XX.py ├── config_func_00_07_XX_00_07_XX.py ├── config_func_00_07_XX_00_07_XX_credential_encryption.py ├── config_func_00_07_XX_01_01_XX.py ├── config_func_00_07_XX_01_02_XX.py ├── config_func_01_02_XX_01_03_XX.py ├── config_func_01_03_XX_01_04_XX.py ├── config_func_01_04_XX_01_06_XX.py ├── config_func_01_06_XX_01_07_XX.py └── config_func_01_07_XX_01_08_XX.py ├── requirements.txt ├── servers.json └── test ├── __init__.py ├── conftest.py ├── firmware.py ├── fw ├── ce1-00.06.02.zip ├── ce1-00.07.05.zip ├── ce1-01.01.01.zip ├── ce1-01.02.05.zip ├── ce1-01.03.01.zip ├── ce1-01.04.01.zip ├── ce1-01.06.02.zip ├── ce1-01.07.01.zip ├── ce1-01.08.01.zip ├── ce1g-01.07.01.zip ├── ce1g-01.08.01.zip ├── ce2-00.06.02.zip ├── ce2-00.07.05.zip ├── ce2-01.01.01.zip ├── ce2-01.02.05.zip ├── ce2-01.03.01.zip ├── ce2-01.04.01.zip ├── ce2-01.06.02.zip ├── ce2-01.07.01.zip ├── ce2-01.08.01.zip ├── ce2g-01.07.01.zip ├── ce2g-01.08.01.zip ├── ce3g-01.07.07.zip └── ce3g-01.08.01.zip ├── s3_client.py ├── s3_server.py ├── s3_simulator.py ├── test_00_07 ├── ce1_00.06_1.json ├── ce1_00.06_2.json ├── ce1_00.07_1.json ├── ce1_00.07_2.json ├── ce2_00.06_1.json ├── ce2_00.06_2.json ├── ce2_00.07_1.json ├── ce2_00.07_2.json └── test_00_07.py ├── test_01_01 ├── ce1_00.07_1.json ├── ce1_00.07_2.json ├── ce1_01.01_1.json ├── ce1_01.01_2.json ├── ce2_00.07_1.json ├── ce2_00.07_2.json ├── ce2_01.01_1.json ├── ce2_01.01_2.json └── test_01_01.py ├── test_01_02 ├── ce1_00.07_1.json ├── ce1_00.07_2.json ├── ce1_00.07_3.json ├── ce1_01.02_1.json ├── ce1_01.02_2.json ├── ce1_01.02_3.json ├── ce2_00.07_1.json ├── ce2_00.07_2.json ├── ce2_01.02_1.json ├── ce2_01.02_2.json └── test_01_02.py ├── test_01_03 ├── ce1_01.02_1.json ├── ce1_01.03_1.json ├── ce2_01.02_1.json ├── ce2_01.02_2.json ├── ce2_01.03_1.json ├── ce2_01.03_2.json └── test_01_03.py ├── test_01_04 ├── ce1_01.03_1.json ├── ce1_01.03_2.json ├── ce1_01.04_1.json ├── ce1_01.04_2.json ├── ce2_01.03_1.json ├── ce2_01.04_1.json └── test_01_04.py ├── test_01_06 ├── ce1_01.04_1.json ├── ce1_01.06_1.json ├── ce2_01.04_1.json ├── ce2_01.06_1.json └── test_01_06.py ├── test_01_07 ├── ce1_01.06_1.json ├── ce1_01.07_1.json ├── ce2_01.06_1.json ├── ce2_01.06_2.json ├── ce2_01.06_3.json ├── ce2_01.07_1.json ├── ce2_01.07_2.json ├── ce2_01.07_3.json └── test_01_07.py ├── test_01_08 ├── ce1-01.07-default.json ├── ce1-01.07-secondaryport-powercycle.json ├── ce1-01.08-default.json ├── ce1-01.08-secondaryport-powercycle.json ├── ce1g-01.07-default.json ├── ce1g-01.08-default.json ├── ce2-01.07-default.json ├── ce2-01.08-default.json ├── ce2g-01.07-default.json ├── ce2g-01.08-default.json ├── ce3g-01.07-default.json ├── ce3g-01.08-default.json └── test_01_08.py └── test_migrate.py /.gitattributes: -------------------------------------------------------------------------------- 1 | *.zip filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.pyc 3 | venv/ 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 christian-steiniche 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /config/config_func_00_06_XX_00_07_XX.py: -------------------------------------------------------------------------------- 1 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 2 | """ 3 | CANedge configuration update function 4 | :param tools: A collection of tools used for device configuration 5 | :param index: Consecutive device index (from 0) 6 | :param device_id: Device ID 7 | :param config_old: The current device configuration 8 | :param config_new: Default new device configuration 9 | :return: Update configuration 10 | """ 11 | 12 | 13 | # This is an example of a firmware upgrade requiring a configuration migration 14 | 15 | # Firmware 00.06.XX to 00.07.XX configuration migration. 16 | 17 | # No changes to GENERAL section 18 | config_new["general"] = config_old["general"] 19 | 20 | # No changes to LOG section 21 | config_new["log"] = config_old["log"] 22 | 23 | # No changes to RTC section 24 | config_new["rtc"] = config_old["rtc"] 25 | 26 | # No changes to CONNECT section 27 | if "connect" in config_old: 28 | config_new["connect"] = config_old["connect"] 29 | 30 | # Secondary port power state changed to power schedule 31 | if "power" in config_old["secondaryport"]: 32 | if config_old["secondaryport"]["power"] == 0: 33 | # Set power schedule to empty list (always off) 34 | config_new['secondaryport'] = {"power_schedule": []} 35 | else: 36 | # Add one element to power schedule list. From 00:00 to 00:00 (always on) 37 | config_new['secondaryport'] = {"power_schedule": [{"from": "00:00", "to": "00:00"}]} 38 | 39 | # New GENERAL, HEARTBEAT and CONTROL sections added to CAN. Set default values 40 | # CAN 1 41 | config_new["can_1"] = config_old["can_1"] 42 | # CAN 1->General 43 | config_new["can_1"]["general"] = {'rx_state': 1, 'tx_state': 1} 44 | # CAN 1->Heartbeat 45 | config_new["can_1"]["heartbeat"] = {'state': 0, 'id_format': 1, 'id': '00435353'} 46 | # CAN 1->Control 47 | config_new["can_1"]["control"] = {'control_rx_state': 0, 48 | 'control_tx_state': 0, 49 | "start": { 50 | "id_format": 1, 51 | "id": "00435354", 52 | "id_mask": "1FFFFFFF", 53 | "data_mask": "FFFFFFFFFFFFFFFF", 54 | "data_high": "0100000000000000", 55 | "data_low": "0100000000000000"}, 56 | "stop": { 57 | "id_format": 1, 58 | "id": "00435354", 59 | "id_mask": "1FFFFFFF", 60 | "data_mask": "FFFFFFFFFFFFFFFF", 61 | "data_high": "0000000000000000", 62 | "data_low": "0000000000000000"} 63 | } 64 | 65 | # CAN 2 66 | config_new["can_2"] = config_old["can_2"] 67 | # CAN 1->General 68 | config_new["can_2"]["general"] = config_new["can_1"]["general"] 69 | # CAN 1->Heartbeat 70 | config_new["can_2"]["heartbeat"] = config_new["can_1"]["heartbeat"] 71 | # CAN 1->Control 72 | config_new["can_2"]["control"] = config_new["can_1"]["control"] 73 | 74 | # New LIN sections added. Set default values 75 | config_new["lin_1"] = {'phy': {'mode': 0, 'bit_rate': 19200}} 76 | config_new["lin_2"] = {'phy': {'mode': 0, 'bit_rate': 19200}} 77 | 78 | return config_new 79 | -------------------------------------------------------------------------------- /config/config_func_00_07_XX_00_07_XX.py: -------------------------------------------------------------------------------- 1 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 2 | """ 3 | CANedge configuration update function 4 | :param tools: A collection of tools used for device configuration 5 | :param index: Consecutive device index (from 0) 6 | :param device_id: Device ID 7 | :param config_old: The current device configuration 8 | :param config_new: Default new device configuration 9 | :return: Update configuration 10 | """ 11 | 12 | # This is an example of a simple configuration update (without firmware upgrade) 13 | 14 | # Firmware 00.07.XX to 00.07.XX configuration update 15 | 16 | # New configuration uses same structure. The old configuration can safely be copied to the new. 17 | config_new = config_old 18 | 19 | # Optionally update specific fields 20 | config_new["general"]["device"]["meta"] = "FW07.01" 21 | 22 | return config_new -------------------------------------------------------------------------------- /config/config_func_00_07_XX_00_07_XX_credential_encryption.py: -------------------------------------------------------------------------------- 1 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 2 | """ 3 | CANedge configuration update function 4 | :param tools: A collection of tools used for device configuration 5 | :param index: Consecutive device index (from 0) 6 | :param device_id: Device ID 7 | :param config_old: The current device configuration 8 | :param config_new: Default new device configuration 9 | :return: Update configuration 10 | """ 11 | 12 | # This is an example of how to upgrade existing access point and S3 credentials from plain to encrypted form. Note 13 | # that below assumes that the existing configuration holds the information in unencrypted form. 14 | # Devices already using encrypted credentials are skipped (no configuration returned) 15 | 16 | # New configuration uses same structure. The old configuration can safely be copied to the new. 17 | config_new = config_old 18 | 19 | # Only update configurations unencrypted credentials 20 | if config_new["connect"]["wifi"]["keyformat"] == 0 and config_new["connect"]["s3"]["server"]["keyformat"] == 0: 21 | 22 | # Set the server kpub 23 | config_new["general"]["security"] = {"kpub": tools.security.user_public_key_base64} 24 | 25 | # Set the access point key format to 1 (encrypted) 26 | config_new["connect"]["wifi"]["keyformat"] = 1 27 | 28 | # Loop each accesspoint in list 29 | for ap in config_new["connect"]["wifi"]["accesspoint"]: 30 | # Encrypt the wifi password 31 | unencrypted_wifi_pwd = ap["pwd"] 32 | ap["pwd"] = tools.security.encrypt_encode(unencrypted_wifi_pwd) 33 | 34 | # Encrypt the S3 secret key 35 | unencrypted_s3_secretkey = config_new["connect"]["s3"]["server"]["secretkey"] 36 | config_new["connect"]["s3"]["server"]["keyformat"] = 1 37 | config_new["connect"]["s3"]["server"]["secretkey"] = tools.security.encrypt_encode(unencrypted_s3_secretkey) 38 | 39 | return config_new 40 | -------------------------------------------------------------------------------- /config/config_func_00_07_XX_01_01_XX.py: -------------------------------------------------------------------------------- 1 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 2 | """ 3 | CANedge configuration update function 4 | :param tools: A collection of tools used for device configuration 5 | :param index: Consecutive device index (from 0) 6 | :param device_id: Device ID 7 | :param config_old: The current device configuration 8 | :param config_new: Default new device configuration 9 | :return: Update configuration 10 | """ 11 | 12 | 13 | # This is an example of a firmware upgrade requiring a configuration migration 14 | 15 | # Firmware 00.07.XX to 01.01.XX configuration migration. 16 | 17 | # No changes to GENERAL section 18 | config_new["general"] = config_old["general"] 19 | 20 | # New structure in LOG section 21 | # The fields previously in LOG moved to LOG->FILE 22 | config_new["log"]["file"] = config_old["log"] 23 | if "compression" not in config_new["log"]: 24 | config_new["log"]["compression"] = {"level": 0} 25 | if "encryption" not in config_new["log"]: 26 | config_new["log"]["encryption"] = {"state": 0} 27 | 28 | # No changes to RTC section 29 | config_new["rtc"] = config_old["rtc"] 30 | 31 | # No changes to SECONDARY PORT section 32 | config_new['secondaryport'] = config_old['secondaryport'] 33 | 34 | # No changes to CAN sections 35 | config_new["can_1"] = config_old["can_1"] 36 | config_new["can_2"] = config_old["can_2"] 37 | 38 | # No changes to LIN sections 39 | config_new["lin_1"] = config_old["lin_1"] 40 | config_new["lin_2"] = config_old["lin_2"] 41 | 42 | # New field in CONNECT section (only CANedge2) 43 | if "connect" in config_old: 44 | config_new["connect"] = config_old["connect"] 45 | if "s3" in config_new["connect"]: 46 | if "server" in config_new["connect"]["s3"]: 47 | if "endpoint" in config_new["connect"]["s3"]["server"]: 48 | if "signed_payload" not in config_new["connect"]["s3"]["server"]: 49 | # Default SIGNED PAYLOAD to disabled 50 | config_new["connect"]["s3"]["server"]["signed_payload"] = 0 51 | 52 | return config_new 53 | -------------------------------------------------------------------------------- /config/config_func_00_07_XX_01_02_XX.py: -------------------------------------------------------------------------------- 1 | def migrate_filter_list(filter_list): 2 | 3 | # Migrate filter prescaler. 4 | # Old structure: 5 | # - "prescaler": count prescaler value 6 | # New structure 7 | # - "prescaler_type": prescaler type, none, value, time or data 8 | # - "prescaler_value": prescaler value 9 | 10 | # Loop each filter element and migrate the presclaer if set 11 | for i, filter_elm in enumerate(filter_list): 12 | if "prescaler" not in filter_elm: 13 | # Prescaler not set, set to prescaler type None (0) 14 | filter_list[i]["prescaler_type"] = 0 15 | else: 16 | # Prescaler set, migrate the count value 17 | if filter_elm["prescaler"] == 0 or filter_elm["prescaler"] == 1: 18 | # Prescaler is set but not used (value is 0 or 1) 19 | filter_list[i]["prescaler_type"] = 0 20 | else: 21 | # Prescaler is set and used. Set to "count" type and reuse the prescaler value 22 | filter_list[i]["prescaler_type"] = 1 23 | filter_list[i]["prescaler_value"] = filter_elm["prescaler"] 24 | 25 | del filter_elm["prescaler"] 26 | 27 | return filter_list 28 | 29 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 30 | """ 31 | CANedge configuration update function 32 | :param tools: A collection of tools used for device configuration 33 | :param index: Consecutive device index (from 0) 34 | :param device_id: Device ID 35 | :param config_old: The current device configuration 36 | :param config_new: Default new device configuration 37 | :return: Update configuration 38 | """ 39 | 40 | # This is an example of a firmware upgrade requiring a configuration migration 41 | 42 | # Firmware 00.07.XX to 01.02.XX configuration migration. 43 | 44 | # No changes to GENERAL section 45 | config_new["general"] = config_old["general"] 46 | 47 | # New structure in LOG section 48 | # The fields previously in LOG moved to LOG->FILE 49 | config_new["log"]["file"] = config_old["log"] 50 | if "compression" not in config_new["log"]: 51 | config_new["log"]["compression"] = {"level": 0} 52 | if "encryption" not in config_new["log"]: 53 | config_new["log"]["encryption"] = {"state": 0} 54 | 55 | # No changes to RTC section 56 | config_new["rtc"] = config_old["rtc"] 57 | 58 | # No changes to SECONDARY PORT section 59 | config_new['secondaryport'] = config_old['secondaryport'] 60 | 61 | # Changes to prescaling in CAN section. Migrate from old to new structure 62 | config_new["can_1"] = config_old["can_1"] 63 | if "filter" in config_new["can_1"]: 64 | config_new["can_1"]["filter"] = migrate_filter_list(config_new["can_1"]["filter"]) 65 | pass 66 | 67 | config_new["can_2"] = config_old["can_2"] 68 | if "filter" in config_new["can_2"]: 69 | config_new["can_2"]["filter"] = migrate_filter_list(config_new["can_2"]["filter"]) 70 | pass 71 | 72 | # No changes to LIN sections 73 | config_new["lin_1"] = config_old["lin_1"] 74 | config_new["lin_2"] = config_old["lin_2"] 75 | 76 | # New field in CONNECT section (only CANedge2) 77 | if "connect" in config_old: 78 | config_new["connect"] = config_old["connect"] 79 | if "s3" in config_new["connect"]: 80 | if "server" in config_new["connect"]["s3"]: 81 | if "endpoint" in config_new["connect"]["s3"]["server"]: 82 | if "signed_payload" not in config_new["connect"]["s3"]["server"]: 83 | # Default SIGNED PAYLOAD to disabled 84 | config_new["connect"]["s3"]["server"]["signed_payload"] = 0 85 | 86 | return config_new 87 | -------------------------------------------------------------------------------- /config/config_func_01_02_XX_01_03_XX.py: -------------------------------------------------------------------------------- 1 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 2 | """ 3 | CANedge configuration update function 4 | :param tools: A collection of tools used for device configuration 5 | :param index: Consecutive device index (from 0) 6 | :param device_id: Device ID 7 | :param config_old: The current device configuration 8 | :param config_new: Default new device configuration 9 | :return: Update configuration 10 | """ 11 | 12 | # This is an example of a firmware upgrade requiring a configuration migration 13 | 14 | # Firmware 01.02.XX to 01.03.XX configuration migration. 15 | 16 | # No changes to GENERAL section 17 | config_new["general"] = config_old["general"] 18 | 19 | # No changes to LOG section 20 | config_new["log"] = config_old["log"] 21 | 22 | # No changes to RTC section 23 | config_new["rtc"] = config_old["rtc"] 24 | 25 | # No changes to SECONDARY PORT section 26 | config_new['secondaryport'] = config_old['secondaryport'] 27 | 28 | # No changes to CAN sections 29 | config_new["can_1"] = config_old["can_1"] 30 | config_new["can_2"] = config_old["can_2"] 31 | 32 | # No changes to LIN sections 33 | config_new["lin_1"] = config_old["lin_1"] 34 | config_new["lin_2"] = config_old["lin_2"] 35 | 36 | # New field in CONNECT section (connect->s3->server->request_style) (only CANedge2) 37 | if "connect" in config_old: 38 | # Copy CONNECT section 39 | config_new["connect"] = config_old["connect"] 40 | 41 | # If a S3 server endpoint is set, add request_style (default to path_style) 42 | if "s3" in config_new["connect"]: 43 | if "server" in config_new["connect"]["s3"]: 44 | if "endpoint" in config_new["connect"]["s3"]["server"]: 45 | if "request_style" not in config_new["connect"]["s3"]["server"]: 46 | config_new["connect"]["s3"]["server"]["request_style"] = 0 47 | 48 | return config_new 49 | -------------------------------------------------------------------------------- /config/config_func_01_03_XX_01_04_XX.py: -------------------------------------------------------------------------------- 1 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 2 | """ 3 | CANedge configuration update function 4 | :param tools: A collection of tools used for device configuration 5 | :param index: Consecutive device index (from 0) 6 | :param device_id: Device ID 7 | :param config_old: The current device configuration 8 | :param config_new: Default new device configuration 9 | :return: Update configuration 10 | """ 11 | 12 | # This is an example of a firmware upgrade requiring a configuration migration 13 | 14 | # Firmware 01.03.XX to 01.04.XX configuration migration. 15 | 16 | # GENERAL section, no changes 17 | config_new["general"] = config_old["general"] 18 | 19 | # LOG section, error_frames added 20 | config_new["log"] = config_old["log"] 21 | config_new["log"]["error_frames"] = {"state": 0} 22 | 23 | # RTC section, no changes 24 | config_new["rtc"] = config_old["rtc"] 25 | 26 | # SECONDARY PORT section, no changes 27 | config_new['secondaryport'] = config_old['secondaryport'] 28 | 29 | # CAN sections, remote_frames added, filter moved 30 | for can_x in ["can_1", "can_2"]: 31 | config_new[can_x] = config_old[can_x] 32 | config_new[can_x]["filter"] = {"remote_frames": 0, "id": config_old[can_x]["filter"]} 33 | 34 | # LIN sections, before optional, now mandatory 35 | for lin_x in ["lin_1", "lin_2"]: 36 | if lin_x in config_old: 37 | config_new[lin_x] = config_old[lin_x] 38 | 39 | # CONNECT section, server->request_style now mandatory 40 | if "connect" in config_old: 41 | config_new["connect"] = config_old["connect"] 42 | 43 | # Add mandatory "request_style" if not already set 44 | if "s3" in config_new["connect"]: 45 | if "server" in config_new["connect"]["s3"]: 46 | if "request_style" not in config_new["connect"]["s3"]["server"]: 47 | config_new["connect"]["s3"]["server"]["request_style"] = 0 48 | 49 | return config_new 50 | -------------------------------------------------------------------------------- /config/config_func_01_04_XX_01_06_XX.py: -------------------------------------------------------------------------------- 1 | def config_func(tools, index, device_type, device_id, config_old: {}, config_new: {}): 2 | """ 3 | CANedge configuration update function 4 | :param tools: A collection of tools used for device configuration 5 | :param index: Consecutive device index (from 0) 6 | :param device_id: Device ID 7 | :param config_old: The current device configuration 8 | :param config_new: Default new device configuration 9 | :return: Update configuration 10 | """ 11 | 12 | # This is an example of a firmware upgrade requiring a configuration migration 13 | 14 | # Firmware 01.04.XX to 01.06.XX configuration migration. 15 | 16 | # GENERAL section, no changes 17 | config_new["general"] = config_old["general"] 18 | 19 | # LOG section, support for error frames added 20 | config_new["log"] = config_old["log"] 21 | 22 | # Set error frame logging state 23 | config_new["log"]["error_frames"] = {"state": 0} 24 | 25 | # RTC section, no changes 26 | config_new["rtc"] = config_old["rtc"] 27 | 28 | # SECONDARY PORT section, no changes 29 | config_new['secondaryport'] = config_old['secondaryport'] 30 | 31 | # CAN sections, no changes 32 | for can_x in ["can_1", "can_2"]: 33 | config_new[can_x] = config_old[can_x] 34 | 35 | # LIN sections, no changes 36 | for lin_x in ["lin_1", "lin_2"]: 37 | config_new[lin_x] = config_old[lin_x] 38 | 39 | # CONNECT section, no changes 40 | if "connect" in config_old: 41 | config_new["connect"] = config_old["connect"] 42 | 43 | return config_new 44 | -------------------------------------------------------------------------------- /config/config_func_01_07_XX_01_08_XX.py: -------------------------------------------------------------------------------- 1 | from collections import OrderedDict 2 | from canedge_manager import CANedgeType, CANedgeTools 3 | 4 | 5 | def config_func(tools: CANedgeTools, index: int, device_type: CANedgeType, device_id: str, config_old: OrderedDict, config_new: OrderedDict) -> OrderedDict: 6 | """ 7 | CANedge configuration update function 8 | :param tools: A collection of tools used for device configuration 9 | :param index: Consecutive device index (from 0) 10 | :param device_type: Device type 11 | :param device_id: Device ID 12 | :param config_old: The current device configuration 13 | :param config_new: The new default device configuration 14 | :return: Update configuration 15 | """ 16 | 17 | # This is an example of a firmware upgrade requiring a configuration migration. 18 | 19 | # Firmware 01.07.XX to 01.08.XX configuration migration. 20 | 21 | # Add the new debug->restart timer. Take the default value from the new default config 22 | config_old["general"]["debug"] = config_new["general"]["debug"] 23 | 24 | # For CE1G, CE2G and CE3G, add the new GNSS distance message (introduced in 01.07.03) if missing 25 | if device_type in [CANedgeType.CANEDGE1G, CANedgeType.CANEDGE2G, CANedgeType.CANEDGE3G]: 26 | 27 | # Get current and new internal filter lists 28 | old_can_internal_filters = config_old.get("can_internal", {}).get("filter", {}).get("id", []) 29 | new_can_internal_filters = config_new.get("can_internal", {}).get("filter", {}).get("id", []) 30 | 31 | # Find "GnssDistance" in both lists 32 | old_gnss_distance = next((x for x in old_can_internal_filters if x.get("name", "") == "GnssDistance"), None) 33 | new_gnss_distance = next((x for x in new_can_internal_filters if x.get("name", "") == "GnssDistance"), None) 34 | 35 | # If GnssDistance not in old list, add 36 | if old_gnss_distance is None and new_gnss_distance is not None: 37 | old_can_internal_filters.insert(5, new_gnss_distance) 38 | 39 | # For CE1, CE2, CE3, fix minor error in 01.07 default config 40 | if device_type in [CANedgeType.CANEDGE1, CANedgeType.CANEDGE2, CANedgeType.CANEDGE3]: 41 | 42 | # Get current filter list 43 | old_can_internal_filters = config_old.get("can_internal", {}).get("filter", {}).get("id", []) 44 | 45 | # If filter "AllExtendedID" exists, ensure the "id_format" is indeed set to "extended" (1) 46 | old_all_extended = next((x for x in old_can_internal_filters if x.get("name", "") == "AllExtendedID"), None) 47 | if isinstance(old_all_extended, dict) and "id_format" in old_all_extended: 48 | old_all_extended["id_format"] = 1 49 | 50 | # # For CE2, CE2G, CE3, CE3G, add new connect->protocol (protocol = 0 is S3) 51 | if device_type in [CANedgeType.CANEDGE2, CANedgeType.CANEDGE2G, CANedgeType.CANEDGE3, CANedgeType.CANEDGE3G]: 52 | connect = config_old.get("connect", None) 53 | if isinstance(connect, OrderedDict): 54 | connect["protocol"] = 0 55 | connect.move_to_end("s3") 56 | 57 | # If present, remove temporary secondaryport->power_cycle field 58 | if config_old.get("secondaryport", {}).get("power_cycle", None) is not None: 59 | del config_old["secondaryport"]["power_cycle"] 60 | 61 | # Return updated config 62 | return config_old -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | minio 2 | jsonschema 3 | pycryptodome 4 | -------------------------------------------------------------------------------- /servers.json: -------------------------------------------------------------------------------- 1 | { 2 | "ALIAS": { 3 | "url": "http://hostname:port", 4 | "accessKey": "ACCESS_KEY", 5 | "secretKey": "SECRET_KEY" 6 | } 7 | } -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CSS-Electronics/canedge_manager/1dfa701fb3248f05bad94342bbee5ab7b49a0239/test/__init__.py -------------------------------------------------------------------------------- /test/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from time import sleep 3 | 4 | from test.s3_client import S3Client 5 | from test.s3_server import S3ServerMinio 6 | 7 | 8 | @pytest.fixture 9 | def bucket_name(): 10 | return 'testbucket' 11 | 12 | @pytest.fixture 13 | def s3_server(tmpdir): 14 | server = S3ServerMinio(tmpdir) 15 | server.start() 16 | sleep(5) 17 | yield server 18 | server.stop() 19 | sleep(1) 20 | 21 | @pytest.fixture 22 | def s3_client(s3_server, bucket_name): 23 | client = S3Client(endpoint=s3_server.endpoint_ip + ":" + str(s3_server.port), 24 | access_key=s3_server.accesskey, 25 | secret_key=s3_server.secretkey, 26 | secure=False) 27 | 28 | # Clear bucket 29 | client.remove_bucket_r(bucket_name) 30 | client.make_bucket(bucket_name) 31 | 32 | return client 33 | -------------------------------------------------------------------------------- /test/firmware.py: -------------------------------------------------------------------------------- 1 | import os 2 | from zipfile import ZipFile 3 | 4 | 5 | def fw_unpack(fw_path, outdir): 6 | 7 | # Unzip firmware package 8 | with ZipFile(fw_path, 'r') as zipObj: 9 | zipObj.extractall(outdir) 10 | 11 | list_dir = os.listdir(outdir) 12 | 13 | firmware_file_name = list(filter(lambda x: 'firmware' in x, list_dir)) 14 | config_file_name = list(filter(lambda x: 'config' in x, list_dir)) 15 | schema_file_name = list(filter(lambda x: 'schema' in x and 'uischema' not in x, list_dir)) 16 | 17 | assert len(firmware_file_name) == 1 18 | assert len(config_file_name) == 1 19 | assert len(schema_file_name) == 1 20 | 21 | firmware_file_name = firmware_file_name[0] 22 | config_file_name = config_file_name[0] 23 | schema_file_name = schema_file_name[0] 24 | 25 | firmware_file_path = os.path.join(outdir, firmware_file_name) 26 | config_file_path = os.path.join(outdir, config_file_name) 27 | schema_file_path = os.path.join(outdir, schema_file_name) 28 | 29 | return {'firmware_path': firmware_file_path, 30 | 'config_path': config_file_path, 31 | 'schema_path': schema_file_path, 32 | 'firmware_name': firmware_file_name, 33 | 'config_name': config_file_name, 34 | 'schema_name': schema_file_name } -------------------------------------------------------------------------------- /test/fw/ce1-00.06.02.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:644c61ff76ec7a441b233974848154050a10543fe7fd3bc616ca81ad168ccedb 3 | size 145239 4 | -------------------------------------------------------------------------------- /test/fw/ce1-00.07.05.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d803057e00b581c339d21ffa86cb5638a107a1b1dde35549a3170b56149bc809 3 | size 163037 4 | -------------------------------------------------------------------------------- /test/fw/ce1-01.01.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:195b75155952f34faa5ce0aeb5eb8313630bc1508b27799101b13bf0f96780a5 3 | size 180223 4 | -------------------------------------------------------------------------------- /test/fw/ce1-01.02.05.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7bfc8b127773e9c8e46d41f5cedf37087ade3ea1e57ba09d35fedb412f1481e1 3 | size 185307 4 | -------------------------------------------------------------------------------- /test/fw/ce1-01.03.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ac6576dceaa4a9d2858746d07de6185bea5de867c823db11119c13423d42dd73 3 | size 181952 4 | -------------------------------------------------------------------------------- /test/fw/ce1-01.04.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f94bcc9eb0e6618b70f1b27ab63ac71efb86676be378444292879be09f20967e 3 | size 203737 4 | -------------------------------------------------------------------------------- /test/fw/ce1-01.06.02.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ba0c7b4d98d525a811d9f3f40ff4754334e83afaa0a7f2a0db32216d97e288b4 3 | size 204173 4 | -------------------------------------------------------------------------------- /test/fw/ce1-01.07.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:62051ba785fcb648ff6fe94e1fb964f273e0ddca03be4bf2ce3d6afc54c0c0a3 3 | size 346505 4 | -------------------------------------------------------------------------------- /test/fw/ce1-01.08.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9543d498d488db2bc25d3d7cd3a91a2ddb6dff61a224dd5bafeed319a2fb05cc 3 | size 354775 4 | -------------------------------------------------------------------------------- /test/fw/ce1g-01.07.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9a2590a1ef37c57eeafcb3103526c6c6c3e96e8a243280f5c7ee63e8041687bd 3 | size 371524 4 | -------------------------------------------------------------------------------- /test/fw/ce1g-01.08.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:30aee8efd688a8ae81b198c1afb266dc95eabf6081399acbe5316d1c3c9587ef 3 | size 1392880 4 | -------------------------------------------------------------------------------- /test/fw/ce2-00.06.02.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2f906f9debdddaa96493c0a0f8624f2c5f65bea9c842ec422cb557a29c52bbb4 3 | size 424478 4 | -------------------------------------------------------------------------------- /test/fw/ce2-00.07.05.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4512c1b37b419c3710784766eb1c9074d7cf080cfe96e34f6f06646805921ea0 3 | size 442123 4 | -------------------------------------------------------------------------------- /test/fw/ce2-01.01.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d906bb71d1aa779152fa0c26b44d8fcadaff05c5b202ad091e2d11749e6f93be 3 | size 462291 4 | -------------------------------------------------------------------------------- /test/fw/ce2-01.02.05.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5c0218babc6255f17292495d27964c431626ca446dd2fc5ab50c5df49c157e8b 3 | size 468842 4 | -------------------------------------------------------------------------------- /test/fw/ce2-01.03.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c261c6bebbd6761cf64afa01d25c9b0fd858608414a85e6ff72562b3c23e2166 3 | size 468352 4 | -------------------------------------------------------------------------------- /test/fw/ce2-01.04.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ab6dc90cca3757ced37b941a88ad8531bce5738f4be48ba6276b92cba496fa3c 3 | size 488943 4 | -------------------------------------------------------------------------------- /test/fw/ce2-01.06.02.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a4c1691f73d15b110767911e16f7feff85ac32fa4e322d253d7865747d6a7fc6 3 | size 487782 4 | -------------------------------------------------------------------------------- /test/fw/ce2-01.07.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96be6daec33498b05e303e71bb51717d5f7355514ff646feace55282c1847497 3 | size 623714 4 | -------------------------------------------------------------------------------- /test/fw/ce2-01.08.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e1530e44fd6d7c183fdebbdc3c774c9e35a6eb356cbbfe6520ad9c4b7ff394c9 3 | size 645261 4 | -------------------------------------------------------------------------------- /test/fw/ce2g-01.07.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d84f983572f630d4dc460f4acb032bb921bff4e4331771d195d801103136cadf 3 | size 646057 4 | -------------------------------------------------------------------------------- /test/fw/ce2g-01.08.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:632bbb9fe321cca8458e7a62d7fd2f1293dfa348d6c40299ca5dc28726f3eed7 3 | size 1682380 4 | -------------------------------------------------------------------------------- /test/fw/ce3g-01.07.07.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fd123af125acfda1ed9a84cae7f5b8b58e2ccce41a965dd08d23f2984be3f42d 3 | size 436784 4 | -------------------------------------------------------------------------------- /test/fw/ce3g-01.08.01.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f84b45b7c7607b6ebb0b7d5888eacf31d3f3ad04aa301b70a6160de3e0bbb51 3 | size 1452545 4 | -------------------------------------------------------------------------------- /test/s3_client.py: -------------------------------------------------------------------------------- 1 | import io 2 | from minio import Minio 3 | 4 | 5 | class S3Client(Minio): 6 | 7 | # Remove bucket recursively (bucket with content) 8 | def remove_bucket_r(self, bucket_name): 9 | 10 | # Check if bucket exists 11 | if self.bucket_exists(bucket_name): 12 | 13 | # List all object paths in bucket 14 | objects = self.list_objects_v2(bucket_name, recursive=True) 15 | 16 | # Remove objects 17 | for obj in objects: 18 | self.remove_object(obj.bucket_name, obj.object_name) 19 | 20 | # Remove bucket 21 | self.remove_bucket(bucket_name) 22 | 23 | # Get list of objects (not iterator) 24 | def list_objects_as_list(self, bucket_name, prefix=""): 25 | return list(self.list_objects_v2(bucket_name, prefix=prefix, recursive=True)) 26 | 27 | # Put object string 28 | def put_object_string(self, bucket_name, object_name, string): 29 | data = io.BytesIO(string.encode()) 30 | nob = data.getbuffer().nbytes 31 | self.put_object(bucket_name, object_name, data, nob) 32 | 33 | pass 34 | -------------------------------------------------------------------------------- /test/s3_server.py: -------------------------------------------------------------------------------- 1 | import os 2 | import socket 3 | import subprocess 4 | 5 | 6 | class S3ServerMinio(object): 7 | def __init__( 8 | self, 9 | storage_path, 10 | port=9000, 11 | access_key="PRJDKN8R6PAXOGTEIK3E", 12 | secret_key="Avz/QFxGZluv9vjwntFqIwXctNx8niFlMg7MzO5O"): 13 | """ 14 | Starts a local minio server 15 | """ 16 | 17 | self._port = port 18 | self._tls = False 19 | self._access_key = access_key 20 | self._secret_key = secret_key 21 | self._process_server = None 22 | self._storage_path = os.path.join(storage_path, "data") 23 | 24 | def __del__(self): 25 | self.stop() 26 | pass 27 | 28 | def start(self) -> None: 29 | """ 30 | Start the server 31 | """ 32 | 33 | # Set environment variables for process 34 | minio_env = os.environ.copy() 35 | minio_env["MINIO_ACCESS_KEY"] = self._access_key 36 | minio_env["MINIO_SECRET_KEY"] = self._secret_key 37 | 38 | # Start a minio server 39 | cmd = [ 40 | "minio", 41 | "server", 42 | self._storage_path, 43 | "--address", 44 | ":" + str(self._port), 45 | ] 46 | self._process_server = subprocess.Popen(cmd, env=minio_env, stdout=subprocess.DEVNULL) 47 | 48 | def stop(self): 49 | if self._process_server is not None: 50 | self._process_server.terminate() 51 | self._process_server = None 52 | 53 | @property 54 | def accesskey(self): 55 | return self._access_key 56 | 57 | @property 58 | def secretkey(self): 59 | return self._secret_key 60 | 61 | @property 62 | def port(self): 63 | return self._port 64 | 65 | @property 66 | def endpoint(self): 67 | return socket.gethostname() 68 | 69 | @property 70 | def endpoint_ip(self): 71 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 72 | s.connect(("8.8.8.8", 80)) 73 | ip = s.getsockname()[0] 74 | s.close() 75 | return ip 76 | 77 | pass 78 | -------------------------------------------------------------------------------- /test/s3_simulator.py: -------------------------------------------------------------------------------- 1 | import json 2 | import random 3 | from canedge_manager import CANedgeType 4 | from test.s3_client import S3Client 5 | 6 | 7 | class S3Simulate(object): 8 | 9 | def __init__(self, s3_client: S3Client, bucket_name): 10 | self._s3_client = s3_client 11 | self._bucket_name = bucket_name 12 | pass 13 | 14 | def populate(self, type: CANedgeType, schema_name: str, config_name: str, config_path, devices_nof=10): 15 | 16 | # Push simulated devices on S3 17 | for i in range(0, devices_nof): 18 | device_id = "{:08X}".format(random.randrange(1 << 32)) 19 | 20 | # Create and push a device.json file 21 | device_obj_name = device_id + '/device.json' 22 | device_obj = json.dumps({"type": type.value, "id": device_id, "sch_name": schema_name, "kpub": ""}) 23 | self._s3_client.put_object_string(self._bucket_name, device_obj_name, device_obj) 24 | 25 | # Push the config file 26 | config_obj_name = device_id + '/' + config_name 27 | self._s3_client.fput_object(self._bucket_name, config_obj_name, config_path) 28 | pass 29 | 30 | -------------------------------------------------------------------------------- /test/test_00_07/ce1_00.06_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power": 0 22 | }, 23 | "can_1": { 24 | "phy": { 25 | "mode": 1, 26 | "retransmission": 1, 27 | "fd_spec": 0, 28 | "bit_rate_cfg_mode": 0 29 | }, 30 | "filter": [ 31 | { 32 | "name": "Ch1AllStandard", 33 | "state": 1, 34 | "type": 0, 35 | "id_format": 0, 36 | "method": 1, 37 | "f1": "7FF", 38 | "f2": "0", 39 | "prescaler": 1 40 | }, 41 | { 42 | "name": "Ch1AllExtended", 43 | "state": 1, 44 | "type": 0, 45 | "id_format": 1, 46 | "method": 1, 47 | "f1": "1FFFFFFF", 48 | "f2": "0", 49 | "prescaler": 1 50 | } 51 | ] 52 | }, 53 | "can_2": { 54 | "phy": { 55 | "mode": 1, 56 | "retransmission": 1, 57 | "fd_spec": 0, 58 | "bit_rate_cfg_mode": 0 59 | }, 60 | "filter": [ 61 | { 62 | "name": "Ch2AllStandard", 63 | "state": 1, 64 | "type": 0, 65 | "id_format": 0, 66 | "method": 1, 67 | "f1": "7FF", 68 | "f2": "0", 69 | "prescaler": 1 70 | }, 71 | { 72 | "name": "Ch2AllExtended", 73 | "state": 1, 74 | "type": 0, 75 | "id_format": 1, 76 | "method": 1, 77 | "f1": "1FFFFFFF", 78 | "f2": "0", 79 | "prescaler": 1 80 | } 81 | ] 82 | } 83 | } -------------------------------------------------------------------------------- /test/test_00_07/ce1_00.06_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power": 1 22 | }, 23 | "can_1": { 24 | "phy": { 25 | "mode": 1, 26 | "retransmission": 1, 27 | "fd_spec": 0, 28 | "bit_rate_cfg_mode": 0 29 | }, 30 | "filter": [ 31 | { 32 | "name": "Ch1AllStandard", 33 | "state": 1, 34 | "type": 0, 35 | "id_format": 0, 36 | "method": 1, 37 | "f1": "7FF", 38 | "f2": "0", 39 | "prescaler": 1 40 | }, 41 | { 42 | "name": "Ch1AllExtended", 43 | "state": 1, 44 | "type": 0, 45 | "id_format": 1, 46 | "method": 1, 47 | "f1": "1FFFFFFF", 48 | "f2": "0", 49 | "prescaler": 1 50 | } 51 | ] 52 | }, 53 | "can_2": { 54 | "phy": { 55 | "mode": 1, 56 | "retransmission": 1, 57 | "fd_spec": 0, 58 | "bit_rate_cfg_mode": 0 59 | }, 60 | "filter": [ 61 | { 62 | "name": "Ch2AllStandard", 63 | "state": 1, 64 | "type": 0, 65 | "id_format": 0, 66 | "method": 1, 67 | "f1": "7FF", 68 | "f2": "0", 69 | "prescaler": 1 70 | }, 71 | { 72 | "name": "Ch2AllExtended", 73 | "state": 1, 74 | "type": 0, 75 | "id_format": 1, 76 | "method": 1, 77 | "f1": "1FFFFFFF", 78 | "f2": "0", 79 | "prescaler": 1 80 | } 81 | ] 82 | } 83 | } -------------------------------------------------------------------------------- /test/test_00_07/ce1_00.07_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power_schedule": [] 22 | }, 23 | "can_1": { 24 | "general": { 25 | "rx_state": 1, 26 | "tx_state": 1 27 | }, 28 | "phy": { 29 | "mode": 1, 30 | "retransmission": 1, 31 | "fd_spec": 0, 32 | "bit_rate_cfg_mode": 0 33 | }, 34 | "filter": [ 35 | { 36 | "name": "Ch1AllStandard", 37 | "state": 1, 38 | "type": 0, 39 | "id_format": 0, 40 | "method": 1, 41 | "f1": "7FF", 42 | "f2": "0", 43 | "prescaler": 1 44 | }, 45 | { 46 | "name": "Ch1AllExtended", 47 | "state": 1, 48 | "type": 0, 49 | "id_format": 1, 50 | "method": 1, 51 | "f1": "1FFFFFFF", 52 | "f2": "0", 53 | "prescaler": 1 54 | } 55 | ], 56 | "heartbeat": { 57 | "state": 0, 58 | "id_format": 1, 59 | "id": "00435353" 60 | }, 61 | "control": { 62 | "control_rx_state": 0, 63 | "control_tx_state": 0, 64 | "start": { 65 | "id_format": 1, 66 | "id": "00435354", 67 | "id_mask": "1FFFFFFF", 68 | "data_mask": "FFFFFFFFFFFFFFFF", 69 | "data_high": "0100000000000000", 70 | "data_low": "0100000000000000" 71 | }, 72 | "stop": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0000000000000000", 78 | "data_low": "0000000000000000" 79 | } 80 | } 81 | }, 82 | "can_2": { 83 | "general": { 84 | "rx_state": 1, 85 | "tx_state": 1 86 | }, 87 | "phy": { 88 | "mode": 1, 89 | "retransmission": 1, 90 | "fd_spec": 0, 91 | "bit_rate_cfg_mode": 0 92 | }, 93 | "filter": [ 94 | { 95 | "name": "Ch2AllStandard", 96 | "state": 1, 97 | "type": 0, 98 | "id_format": 0, 99 | "method": 1, 100 | "f1": "7FF", 101 | "f2": "0", 102 | "prescaler": 1 103 | }, 104 | { 105 | "name": "Ch2AllExtended", 106 | "state": 1, 107 | "type": 0, 108 | "id_format": 1, 109 | "method": 1, 110 | "f1": "1FFFFFFF", 111 | "f2": "0", 112 | "prescaler": 1 113 | } 114 | ], 115 | "heartbeat": { 116 | "state": 0, 117 | "id_format": 1, 118 | "id": "00435353" 119 | }, 120 | "control": { 121 | "control_rx_state": 0, 122 | "control_tx_state": 0, 123 | "start": { 124 | "id_format": 1, 125 | "id": "00435354", 126 | "id_mask": "1FFFFFFF", 127 | "data_mask": "FFFFFFFFFFFFFFFF", 128 | "data_high": "0100000000000000", 129 | "data_low": "0100000000000000" 130 | }, 131 | "stop": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0000000000000000", 137 | "data_low": "0000000000000000" 138 | } 139 | } 140 | }, 141 | "lin_1": { 142 | "phy": { 143 | "mode": 0, 144 | "bit_rate": 19200 145 | } 146 | }, 147 | "lin_2": { 148 | "phy": { 149 | "mode": 0, 150 | "bit_rate": 19200 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /test/test_00_07/ce1_00.07_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power_schedule": [ 22 | { 23 | "from": "00:00", 24 | "to": "00:00" 25 | } 26 | ] 27 | }, 28 | "can_1": { 29 | "general": { 30 | "rx_state": 1, 31 | "tx_state": 1 32 | }, 33 | "phy": { 34 | "mode": 1, 35 | "retransmission": 1, 36 | "fd_spec": 0, 37 | "bit_rate_cfg_mode": 0 38 | }, 39 | "filter": [ 40 | { 41 | "name": "Ch1AllStandard", 42 | "state": 1, 43 | "type": 0, 44 | "id_format": 0, 45 | "method": 1, 46 | "f1": "7FF", 47 | "f2": "0", 48 | "prescaler": 1 49 | }, 50 | { 51 | "name": "Ch1AllExtended", 52 | "state": 1, 53 | "type": 0, 54 | "id_format": 1, 55 | "method": 1, 56 | "f1": "1FFFFFFF", 57 | "f2": "0", 58 | "prescaler": 1 59 | } 60 | ], 61 | "heartbeat": { 62 | "state": 0, 63 | "id_format": 1, 64 | "id": "00435353" 65 | }, 66 | "control": { 67 | "control_rx_state": 0, 68 | "control_tx_state": 0, 69 | "start": { 70 | "id_format": 1, 71 | "id": "00435354", 72 | "id_mask": "1FFFFFFF", 73 | "data_mask": "FFFFFFFFFFFFFFFF", 74 | "data_high": "0100000000000000", 75 | "data_low": "0100000000000000" 76 | }, 77 | "stop": { 78 | "id_format": 1, 79 | "id": "00435354", 80 | "id_mask": "1FFFFFFF", 81 | "data_mask": "FFFFFFFFFFFFFFFF", 82 | "data_high": "0000000000000000", 83 | "data_low": "0000000000000000" 84 | } 85 | } 86 | }, 87 | "can_2": { 88 | "general": { 89 | "rx_state": 1, 90 | "tx_state": 1 91 | }, 92 | "phy": { 93 | "mode": 1, 94 | "retransmission": 1, 95 | "fd_spec": 0, 96 | "bit_rate_cfg_mode": 0 97 | }, 98 | "filter": [ 99 | { 100 | "name": "Ch2AllStandard", 101 | "state": 1, 102 | "type": 0, 103 | "id_format": 0, 104 | "method": 1, 105 | "f1": "7FF", 106 | "f2": "0", 107 | "prescaler": 1 108 | }, 109 | { 110 | "name": "Ch2AllExtended", 111 | "state": 1, 112 | "type": 0, 113 | "id_format": 1, 114 | "method": 1, 115 | "f1": "1FFFFFFF", 116 | "f2": "0", 117 | "prescaler": 1 118 | } 119 | ], 120 | "heartbeat": { 121 | "state": 0, 122 | "id_format": 1, 123 | "id": "00435353" 124 | }, 125 | "control": { 126 | "control_rx_state": 0, 127 | "control_tx_state": 0, 128 | "start": { 129 | "id_format": 1, 130 | "id": "00435354", 131 | "id_mask": "1FFFFFFF", 132 | "data_mask": "FFFFFFFFFFFFFFFF", 133 | "data_high": "0100000000000000", 134 | "data_low": "0100000000000000" 135 | }, 136 | "stop": { 137 | "id_format": 1, 138 | "id": "00435354", 139 | "id_mask": "1FFFFFFF", 140 | "data_mask": "FFFFFFFFFFFFFFFF", 141 | "data_high": "0000000000000000", 142 | "data_low": "0000000000000000" 143 | } 144 | } 145 | }, 146 | "lin_1": { 147 | "phy": { 148 | "mode": 0, 149 | "bit_rate": 19200 150 | } 151 | }, 152 | "lin_2": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | } 158 | } -------------------------------------------------------------------------------- /test/test_00_07/ce2_00.06_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "connect": { 24 | "wifi": { 25 | "mode": 0, 26 | "keyformat": 0, 27 | "accesspoint": [] 28 | }, 29 | "s3": { 30 | "sync": { 31 | "ota": 600, 32 | "heartbeat": 300, 33 | "logfiles": 1 34 | }, 35 | "server": {} 36 | } 37 | }, 38 | "secondaryport": { 39 | "power": 0 40 | }, 41 | "can_1": { 42 | "phy": { 43 | "mode": 1, 44 | "retransmission": 1, 45 | "fd_spec": 0, 46 | "bit_rate_cfg_mode": 0 47 | }, 48 | "filter": [ 49 | { 50 | "name": "Ch1AllStandard", 51 | "state": 1, 52 | "type": 0, 53 | "id_format": 0, 54 | "method": 1, 55 | "f1": "7FF", 56 | "f2": "0", 57 | "prescaler": 1 58 | }, 59 | { 60 | "name": "Ch1AllExtended", 61 | "state": 1, 62 | "type": 0, 63 | "id_format": 1, 64 | "method": 1, 65 | "f1": "1FFFFFFF", 66 | "f2": "0", 67 | "prescaler": 1 68 | } 69 | ] 70 | }, 71 | "can_2": { 72 | "phy": { 73 | "mode": 1, 74 | "retransmission": 1, 75 | "fd_spec": 0, 76 | "bit_rate_cfg_mode": 0 77 | }, 78 | "filter": [ 79 | { 80 | "name": "Ch2AllStandard", 81 | "state": 1, 82 | "type": 0, 83 | "id_format": 0, 84 | "method": 1, 85 | "f1": "7FF", 86 | "f2": "0", 87 | "prescaler": 1 88 | }, 89 | { 90 | "name": "Ch2AllExtended", 91 | "state": 1, 92 | "type": 0, 93 | "id_format": 1, 94 | "method": 1, 95 | "f1": "1FFFFFFF", 96 | "f2": "0", 97 | "prescaler": 1 98 | } 99 | ] 100 | } 101 | } -------------------------------------------------------------------------------- /test/test_00_07/ce2_00.06_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "connect": { 24 | "wifi": { 25 | "mode": 0, 26 | "keyformat": 0, 27 | "accesspoint": [] 28 | }, 29 | "s3": { 30 | "sync": { 31 | "ota": 600, 32 | "heartbeat": 300, 33 | "logfiles": 1 34 | }, 35 | "server": {} 36 | } 37 | }, 38 | "secondaryport": { 39 | "power": 1 40 | }, 41 | "can_1": { 42 | "phy": { 43 | "mode": 1, 44 | "retransmission": 1, 45 | "fd_spec": 0, 46 | "bit_rate_cfg_mode": 0 47 | }, 48 | "filter": [ 49 | { 50 | "name": "Ch1AllStandard", 51 | "state": 1, 52 | "type": 0, 53 | "id_format": 0, 54 | "method": 1, 55 | "f1": "7FF", 56 | "f2": "0", 57 | "prescaler": 1 58 | }, 59 | { 60 | "name": "Ch1AllExtended", 61 | "state": 1, 62 | "type": 0, 63 | "id_format": 1, 64 | "method": 1, 65 | "f1": "1FFFFFFF", 66 | "f2": "0", 67 | "prescaler": 1 68 | } 69 | ] 70 | }, 71 | "can_2": { 72 | "phy": { 73 | "mode": 1, 74 | "retransmission": 1, 75 | "fd_spec": 0, 76 | "bit_rate_cfg_mode": 0 77 | }, 78 | "filter": [ 79 | { 80 | "name": "Ch2AllStandard", 81 | "state": 1, 82 | "type": 0, 83 | "id_format": 0, 84 | "method": 1, 85 | "f1": "7FF", 86 | "f2": "0", 87 | "prescaler": 1 88 | }, 89 | { 90 | "name": "Ch2AllExtended", 91 | "state": 1, 92 | "type": 0, 93 | "id_format": 1, 94 | "method": 1, 95 | "f1": "1FFFFFFF", 96 | "f2": "0", 97 | "prescaler": 1 98 | } 99 | ] 100 | } 101 | } -------------------------------------------------------------------------------- /test/test_00_07/ce2_00.07_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "secondaryport": { 24 | "power_schedule": [] 25 | }, 26 | "can_1": { 27 | "general": { 28 | "rx_state": 1, 29 | "tx_state": 1 30 | }, 31 | "phy": { 32 | "mode": 1, 33 | "retransmission": 1, 34 | "fd_spec": 0, 35 | "bit_rate_cfg_mode": 0 36 | }, 37 | "filter": [ 38 | { 39 | "name": "Ch1AllStandard", 40 | "state": 1, 41 | "type": 0, 42 | "id_format": 0, 43 | "method": 1, 44 | "f1": "7FF", 45 | "f2": "0", 46 | "prescaler": 1 47 | }, 48 | { 49 | "name": "Ch1AllExtended", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 1, 53 | "method": 1, 54 | "f1": "1FFFFFFF", 55 | "f2": "0", 56 | "prescaler": 1 57 | } 58 | ], 59 | "heartbeat": { 60 | "state": 0, 61 | "id_format": 1, 62 | "id": "00435353" 63 | }, 64 | "control": { 65 | "control_rx_state": 0, 66 | "control_tx_state": 0, 67 | "start": { 68 | "id_format": 1, 69 | "id": "00435354", 70 | "id_mask": "1FFFFFFF", 71 | "data_mask": "FFFFFFFFFFFFFFFF", 72 | "data_high": "0100000000000000", 73 | "data_low": "0100000000000000" 74 | }, 75 | "stop": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0000000000000000", 81 | "data_low": "0000000000000000" 82 | } 83 | } 84 | }, 85 | "can_2": { 86 | "general": { 87 | "rx_state": 1, 88 | "tx_state": 1 89 | }, 90 | "phy": { 91 | "mode": 1, 92 | "retransmission": 1, 93 | "fd_spec": 0, 94 | "bit_rate_cfg_mode": 0 95 | }, 96 | "filter": [ 97 | { 98 | "name": "Ch2AllStandard", 99 | "state": 1, 100 | "type": 0, 101 | "id_format": 0, 102 | "method": 1, 103 | "f1": "7FF", 104 | "f2": "0", 105 | "prescaler": 1 106 | }, 107 | { 108 | "name": "Ch2AllExtended", 109 | "state": 1, 110 | "type": 0, 111 | "id_format": 1, 112 | "method": 1, 113 | "f1": "1FFFFFFF", 114 | "f2": "0", 115 | "prescaler": 1 116 | } 117 | ], 118 | "heartbeat": { 119 | "state": 0, 120 | "id_format": 1, 121 | "id": "00435353" 122 | }, 123 | "control": { 124 | "control_rx_state": 0, 125 | "control_tx_state": 0, 126 | "start": { 127 | "id_format": 1, 128 | "id": "00435354", 129 | "id_mask": "1FFFFFFF", 130 | "data_mask": "FFFFFFFFFFFFFFFF", 131 | "data_high": "0100000000000000", 132 | "data_low": "0100000000000000" 133 | }, 134 | "stop": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0000000000000000", 140 | "data_low": "0000000000000000" 141 | } 142 | } 143 | }, 144 | "lin_1": { 145 | "phy": { 146 | "mode": 0, 147 | "bit_rate": 19200 148 | } 149 | }, 150 | "lin_2": { 151 | "phy": { 152 | "mode": 0, 153 | "bit_rate": 19200 154 | } 155 | }, 156 | "connect": { 157 | "wifi": { 158 | "mode": 0, 159 | "keyformat": 0, 160 | "accesspoint": [] 161 | }, 162 | "s3": { 163 | "sync": { 164 | "ota": 600, 165 | "heartbeat": 300, 166 | "logfiles": 1 167 | }, 168 | "server": {} 169 | } 170 | } 171 | } -------------------------------------------------------------------------------- /test/test_00_07/ce2_00.07_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "secondaryport": { 24 | "power_schedule": [ 25 | { 26 | "from": "00:00", 27 | "to": "00:00" 28 | } 29 | ] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler": 1 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler": 1 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler": 1 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler": 1 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | }, 161 | "connect": { 162 | "wifi": { 163 | "mode": 0, 164 | "keyformat": 0, 165 | "accesspoint": [] 166 | }, 167 | "s3": { 168 | "sync": { 169 | "ota": 600, 170 | "heartbeat": 300, 171 | "logfiles": 1 172 | }, 173 | "server": {} 174 | } 175 | } 176 | } -------------------------------------------------------------------------------- /test/test_00_07/test_00_07.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | 6 | class Test_00_07(TestMigrate): 7 | 8 | _simulated_devices_nof = 10 9 | 10 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 11 | [ 12 | # CANedge 1 13 | ( 14 | CANedgeType.CANEDGE1, 15 | "fw/ce1-00.06.02.zip", 16 | "fw/ce1-00.07.05.zip", 17 | "test_00_07/ce1_00.06_1.json", 18 | "test_00_07/ce1_00.07_1.json", 19 | "config.config_func_00_06_XX_00_07_XX" 20 | ), 21 | ( 22 | CANedgeType.CANEDGE1, 23 | "fw/ce1-00.06.02.zip", 24 | "fw/ce1-00.07.05.zip", 25 | "test_00_07/ce1_00.06_2.json", 26 | "test_00_07/ce1_00.07_2.json", 27 | "config.config_func_00_06_XX_00_07_XX" 28 | ), 29 | # CANedge 2 30 | ( 31 | CANedgeType.CANEDGE2, 32 | "fw/ce2-00.06.02.zip", 33 | "fw/ce2-00.07.05.zip", 34 | "test_00_07/ce2_00.06_1.json", 35 | "test_00_07/ce2_00.07_1.json", 36 | "config.config_func_00_06_XX_00_07_XX" 37 | ), 38 | ( 39 | CANedgeType.CANEDGE2, 40 | "fw/ce2-00.06.02.zip", 41 | "fw/ce2-00.07.05.zip", 42 | "test_00_07/ce2_00.06_2.json", 43 | "test_00_07/ce2_00.07_2.json", 44 | "config.config_func_00_06_XX_00_07_XX" 45 | ), 46 | ]) 47 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 48 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 49 | -------------------------------------------------------------------------------- /test/test_01_01/ce1_00.07_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power_schedule": [] 22 | }, 23 | "can_1": { 24 | "general": { 25 | "rx_state": 1, 26 | "tx_state": 1 27 | }, 28 | "phy": { 29 | "mode": 1, 30 | "retransmission": 1, 31 | "fd_spec": 0, 32 | "bit_rate_cfg_mode": 0 33 | }, 34 | "filter": [ 35 | { 36 | "name": "Ch1AllStandard", 37 | "state": 1, 38 | "type": 0, 39 | "id_format": 0, 40 | "method": 1, 41 | "f1": "7FF", 42 | "f2": "0", 43 | "prescaler": 1 44 | }, 45 | { 46 | "name": "Ch1AllExtended", 47 | "state": 1, 48 | "type": 0, 49 | "id_format": 1, 50 | "method": 1, 51 | "f1": "1FFFFFFF", 52 | "f2": "0", 53 | "prescaler": 1 54 | } 55 | ], 56 | "heartbeat": { 57 | "state": 0, 58 | "id_format": 1, 59 | "id": "00435353" 60 | }, 61 | "control": { 62 | "control_rx_state": 0, 63 | "control_tx_state": 0, 64 | "start": { 65 | "id_format": 1, 66 | "id": "00435354", 67 | "id_mask": "1FFFFFFF", 68 | "data_mask": "FFFFFFFFFFFFFFFF", 69 | "data_high": "0100000000000000", 70 | "data_low": "0100000000000000" 71 | }, 72 | "stop": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0000000000000000", 78 | "data_low": "0000000000000000" 79 | } 80 | } 81 | }, 82 | "can_2": { 83 | "general": { 84 | "rx_state": 1, 85 | "tx_state": 1 86 | }, 87 | "phy": { 88 | "mode": 1, 89 | "retransmission": 1, 90 | "fd_spec": 0, 91 | "bit_rate_cfg_mode": 0 92 | }, 93 | "filter": [ 94 | { 95 | "name": "Ch2AllStandard", 96 | "state": 1, 97 | "type": 0, 98 | "id_format": 0, 99 | "method": 1, 100 | "f1": "7FF", 101 | "f2": "0", 102 | "prescaler": 1 103 | }, 104 | { 105 | "name": "Ch2AllExtended", 106 | "state": 1, 107 | "type": 0, 108 | "id_format": 1, 109 | "method": 1, 110 | "f1": "1FFFFFFF", 111 | "f2": "0", 112 | "prescaler": 1 113 | } 114 | ], 115 | "heartbeat": { 116 | "state": 0, 117 | "id_format": 1, 118 | "id": "00435353" 119 | }, 120 | "control": { 121 | "control_rx_state": 0, 122 | "control_tx_state": 0, 123 | "start": { 124 | "id_format": 1, 125 | "id": "00435354", 126 | "id_mask": "1FFFFFFF", 127 | "data_mask": "FFFFFFFFFFFFFFFF", 128 | "data_high": "0100000000000000", 129 | "data_low": "0100000000000000" 130 | }, 131 | "stop": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0000000000000000", 137 | "data_low": "0000000000000000" 138 | } 139 | } 140 | }, 141 | "lin_1": { 142 | "phy": { 143 | "mode": 0, 144 | "bit_rate": 19200 145 | } 146 | }, 147 | "lin_2": { 148 | "phy": { 149 | "mode": 0, 150 | "bit_rate": 19200 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /test/test_01_01/ce1_00.07_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 5, 11 | "split_time_period": 120, 12 | "split_time_offset": 60, 13 | "cyclic": 0 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power_schedule": [] 22 | }, 23 | "can_1": { 24 | "general": { 25 | "rx_state": 1, 26 | "tx_state": 1 27 | }, 28 | "phy": { 29 | "mode": 1, 30 | "retransmission": 1, 31 | "fd_spec": 0, 32 | "bit_rate_cfg_mode": 0 33 | }, 34 | "filter": [ 35 | { 36 | "name": "Ch1AllStandard", 37 | "state": 1, 38 | "type": 0, 39 | "id_format": 0, 40 | "method": 1, 41 | "f1": "7FF", 42 | "f2": "0", 43 | "prescaler": 1 44 | }, 45 | { 46 | "name": "Ch1AllExtended", 47 | "state": 1, 48 | "type": 0, 49 | "id_format": 1, 50 | "method": 1, 51 | "f1": "1FFFFFFF", 52 | "f2": "0", 53 | "prescaler": 1 54 | } 55 | ], 56 | "heartbeat": { 57 | "state": 0, 58 | "id_format": 1, 59 | "id": "00435353" 60 | }, 61 | "control": { 62 | "control_rx_state": 0, 63 | "control_tx_state": 0, 64 | "start": { 65 | "id_format": 1, 66 | "id": "00435354", 67 | "id_mask": "1FFFFFFF", 68 | "data_mask": "FFFFFFFFFFFFFFFF", 69 | "data_high": "0100000000000000", 70 | "data_low": "0100000000000000" 71 | }, 72 | "stop": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0000000000000000", 78 | "data_low": "0000000000000000" 79 | } 80 | } 81 | }, 82 | "can_2": { 83 | "general": { 84 | "rx_state": 1, 85 | "tx_state": 1 86 | }, 87 | "phy": { 88 | "mode": 1, 89 | "retransmission": 1, 90 | "fd_spec": 0, 91 | "bit_rate_cfg_mode": 0 92 | }, 93 | "filter": [ 94 | { 95 | "name": "Ch2AllStandard", 96 | "state": 1, 97 | "type": 0, 98 | "id_format": 0, 99 | "method": 1, 100 | "f1": "7FF", 101 | "f2": "0", 102 | "prescaler": 1 103 | }, 104 | { 105 | "name": "Ch2AllExtended", 106 | "state": 1, 107 | "type": 0, 108 | "id_format": 1, 109 | "method": 1, 110 | "f1": "1FFFFFFF", 111 | "f2": "0", 112 | "prescaler": 1 113 | } 114 | ], 115 | "heartbeat": { 116 | "state": 0, 117 | "id_format": 1, 118 | "id": "00435353" 119 | }, 120 | "control": { 121 | "control_rx_state": 0, 122 | "control_tx_state": 0, 123 | "start": { 124 | "id_format": 1, 125 | "id": "00435354", 126 | "id_mask": "1FFFFFFF", 127 | "data_mask": "FFFFFFFFFFFFFFFF", 128 | "data_high": "0100000000000000", 129 | "data_low": "0100000000000000" 130 | }, 131 | "stop": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0000000000000000", 137 | "data_low": "0000000000000000" 138 | } 139 | } 140 | }, 141 | "lin_1": { 142 | "phy": { 143 | "mode": 0, 144 | "bit_rate": 19200 145 | } 146 | }, 147 | "lin_2": { 148 | "phy": { 149 | "mode": 0, 150 | "bit_rate": 19200 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /test/test_01_01/ce1_01.01_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler": 1 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler": 1 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler": 1 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler": 1 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /test/test_01_01/ce1_01.01_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 5, 12 | "split_time_period": 120, 13 | "split_time_offset": 60, 14 | "cyclic": 0 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler": 1 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler": 1 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler": 1 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler": 1 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /test/test_01_01/ce2_00.07_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "secondaryport": { 24 | "power_schedule": [] 25 | }, 26 | "can_1": { 27 | "general": { 28 | "rx_state": 1, 29 | "tx_state": 1 30 | }, 31 | "phy": { 32 | "mode": 1, 33 | "retransmission": 1, 34 | "fd_spec": 0, 35 | "bit_rate_cfg_mode": 0 36 | }, 37 | "filter": [ 38 | { 39 | "name": "Ch1AllStandard", 40 | "state": 1, 41 | "type": 0, 42 | "id_format": 0, 43 | "method": 1, 44 | "f1": "7FF", 45 | "f2": "0", 46 | "prescaler": 1 47 | }, 48 | { 49 | "name": "Ch1AllExtended", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 1, 53 | "method": 1, 54 | "f1": "1FFFFFFF", 55 | "f2": "0", 56 | "prescaler": 1 57 | } 58 | ], 59 | "heartbeat": { 60 | "state": 0, 61 | "id_format": 1, 62 | "id": "00435353" 63 | }, 64 | "control": { 65 | "control_rx_state": 0, 66 | "control_tx_state": 0, 67 | "start": { 68 | "id_format": 1, 69 | "id": "00435354", 70 | "id_mask": "1FFFFFFF", 71 | "data_mask": "FFFFFFFFFFFFFFFF", 72 | "data_high": "0100000000000000", 73 | "data_low": "0100000000000000" 74 | }, 75 | "stop": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0000000000000000", 81 | "data_low": "0000000000000000" 82 | } 83 | } 84 | }, 85 | "can_2": { 86 | "general": { 87 | "rx_state": 1, 88 | "tx_state": 1 89 | }, 90 | "phy": { 91 | "mode": 1, 92 | "retransmission": 1, 93 | "fd_spec": 0, 94 | "bit_rate_cfg_mode": 0 95 | }, 96 | "filter": [ 97 | { 98 | "name": "Ch2AllStandard", 99 | "state": 1, 100 | "type": 0, 101 | "id_format": 0, 102 | "method": 1, 103 | "f1": "7FF", 104 | "f2": "0", 105 | "prescaler": 1 106 | }, 107 | { 108 | "name": "Ch2AllExtended", 109 | "state": 1, 110 | "type": 0, 111 | "id_format": 1, 112 | "method": 1, 113 | "f1": "1FFFFFFF", 114 | "f2": "0", 115 | "prescaler": 1 116 | } 117 | ], 118 | "heartbeat": { 119 | "state": 0, 120 | "id_format": 1, 121 | "id": "00435353" 122 | }, 123 | "control": { 124 | "control_rx_state": 0, 125 | "control_tx_state": 0, 126 | "start": { 127 | "id_format": 1, 128 | "id": "00435354", 129 | "id_mask": "1FFFFFFF", 130 | "data_mask": "FFFFFFFFFFFFFFFF", 131 | "data_high": "0100000000000000", 132 | "data_low": "0100000000000000" 133 | }, 134 | "stop": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0000000000000000", 140 | "data_low": "0000000000000000" 141 | } 142 | } 143 | }, 144 | "lin_1": { 145 | "phy": { 146 | "mode": 0, 147 | "bit_rate": 19200 148 | } 149 | }, 150 | "lin_2": { 151 | "phy": { 152 | "mode": 0, 153 | "bit_rate": 19200 154 | } 155 | }, 156 | "connect": { 157 | "wifi": { 158 | "mode": 0, 159 | "keyformat": 0, 160 | "accesspoint": [] 161 | }, 162 | "s3": { 163 | "sync": { 164 | "ota": 600, 165 | "heartbeat": 300, 166 | "logfiles": 1 167 | }, 168 | "server": {} 169 | } 170 | } 171 | } -------------------------------------------------------------------------------- /test/test_01_01/ce2_00.07_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "secondaryport": { 24 | "power_schedule": [] 25 | }, 26 | "can_1": { 27 | "general": { 28 | "rx_state": 1, 29 | "tx_state": 1 30 | }, 31 | "phy": { 32 | "mode": 1, 33 | "retransmission": 1, 34 | "fd_spec": 0, 35 | "bit_rate_cfg_mode": 0 36 | }, 37 | "filter": [ 38 | { 39 | "name": "Ch1AllStandard", 40 | "state": 1, 41 | "type": 0, 42 | "id_format": 0, 43 | "method": 1, 44 | "f1": "7FF", 45 | "f2": "0", 46 | "prescaler": 1 47 | }, 48 | { 49 | "name": "Ch1AllExtended", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 1, 53 | "method": 1, 54 | "f1": "1FFFFFFF", 55 | "f2": "0", 56 | "prescaler": 1 57 | } 58 | ], 59 | "heartbeat": { 60 | "state": 0, 61 | "id_format": 1, 62 | "id": "00435353" 63 | }, 64 | "control": { 65 | "control_rx_state": 0, 66 | "control_tx_state": 0, 67 | "start": { 68 | "id_format": 1, 69 | "id": "00435354", 70 | "id_mask": "1FFFFFFF", 71 | "data_mask": "FFFFFFFFFFFFFFFF", 72 | "data_high": "0100000000000000", 73 | "data_low": "0100000000000000" 74 | }, 75 | "stop": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0000000000000000", 81 | "data_low": "0000000000000000" 82 | } 83 | } 84 | }, 85 | "can_2": { 86 | "general": { 87 | "rx_state": 1, 88 | "tx_state": 1 89 | }, 90 | "phy": { 91 | "mode": 1, 92 | "retransmission": 1, 93 | "fd_spec": 0, 94 | "bit_rate_cfg_mode": 0 95 | }, 96 | "filter": [ 97 | { 98 | "name": "Ch2AllStandard", 99 | "state": 1, 100 | "type": 0, 101 | "id_format": 0, 102 | "method": 1, 103 | "f1": "7FF", 104 | "f2": "0", 105 | "prescaler": 1 106 | }, 107 | { 108 | "name": "Ch2AllExtended", 109 | "state": 1, 110 | "type": 0, 111 | "id_format": 1, 112 | "method": 1, 113 | "f1": "1FFFFFFF", 114 | "f2": "0", 115 | "prescaler": 1 116 | } 117 | ], 118 | "heartbeat": { 119 | "state": 0, 120 | "id_format": 1, 121 | "id": "00435353" 122 | }, 123 | "control": { 124 | "control_rx_state": 0, 125 | "control_tx_state": 0, 126 | "start": { 127 | "id_format": 1, 128 | "id": "00435354", 129 | "id_mask": "1FFFFFFF", 130 | "data_mask": "FFFFFFFFFFFFFFFF", 131 | "data_high": "0100000000000000", 132 | "data_low": "0100000000000000" 133 | }, 134 | "stop": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0000000000000000", 140 | "data_low": "0000000000000000" 141 | } 142 | } 143 | }, 144 | "lin_1": { 145 | "phy": { 146 | "mode": 0, 147 | "bit_rate": 19200 148 | } 149 | }, 150 | "lin_2": { 151 | "phy": { 152 | "mode": 0, 153 | "bit_rate": 19200 154 | } 155 | }, 156 | "connect": { 157 | "wifi": { 158 | "mode": 0, 159 | "keyformat": 0, 160 | "accesspoint": [ 161 | { 162 | "ssid": "SSID1", 163 | "pwd": "SSID1PW", 164 | "minrssi": 0 165 | } 166 | ] 167 | }, 168 | "s3": { 169 | "sync": { 170 | "ota": 600, 171 | "heartbeat": 300, 172 | "logfiles": 1 173 | }, 174 | "server": { 175 | "endpoint": "http://test.com", 176 | "port": 9000, 177 | "bucket": "bucket", 178 | "region": "eu-central-1", 179 | "accesskey": "AABBCCDDEEFF", 180 | "keyformat": 0, 181 | "secretkey": "001122334455" 182 | } 183 | } 184 | } 185 | } -------------------------------------------------------------------------------- /test/test_01_01/ce2_01.01_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 2, 25 | "timezone": 0, 26 | "adjustment": 0, 27 | "ntp_server": "*.pool.ntp.org", 28 | "ntp_fallback": 0, 29 | "tolerance": 30 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": [ 46 | { 47 | "name": "Ch1AllStandard", 48 | "state": 1, 49 | "type": 0, 50 | "id_format": 0, 51 | "method": 1, 52 | "f1": "7FF", 53 | "f2": "0", 54 | "prescaler": 1 55 | }, 56 | { 57 | "name": "Ch1AllExtended", 58 | "state": 1, 59 | "type": 0, 60 | "id_format": 1, 61 | "method": 1, 62 | "f1": "1FFFFFFF", 63 | "f2": "0", 64 | "prescaler": 1 65 | } 66 | ], 67 | "heartbeat": { 68 | "state": 0, 69 | "id_format": 1, 70 | "id": "00435353" 71 | }, 72 | "control": { 73 | "control_rx_state": 0, 74 | "control_tx_state": 0, 75 | "start": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0100000000000000", 81 | "data_low": "0100000000000000" 82 | }, 83 | "stop": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0000000000000000", 89 | "data_low": "0000000000000000" 90 | } 91 | } 92 | }, 93 | "can_2": { 94 | "general": { 95 | "rx_state": 1, 96 | "tx_state": 1 97 | }, 98 | "phy": { 99 | "mode": 1, 100 | "retransmission": 1, 101 | "fd_spec": 0, 102 | "bit_rate_cfg_mode": 0 103 | }, 104 | "filter": [ 105 | { 106 | "name": "Ch2AllStandard", 107 | "state": 1, 108 | "type": 0, 109 | "id_format": 0, 110 | "method": 1, 111 | "f1": "7FF", 112 | "f2": "0", 113 | "prescaler": 1 114 | }, 115 | { 116 | "name": "Ch2AllExtended", 117 | "state": 1, 118 | "type": 0, 119 | "id_format": 1, 120 | "method": 1, 121 | "f1": "1FFFFFFF", 122 | "f2": "0", 123 | "prescaler": 1 124 | } 125 | ], 126 | "heartbeat": { 127 | "state": 0, 128 | "id_format": 1, 129 | "id": "00435353" 130 | }, 131 | "control": { 132 | "control_rx_state": 0, 133 | "control_tx_state": 0, 134 | "start": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0100000000000000", 140 | "data_low": "0100000000000000" 141 | }, 142 | "stop": { 143 | "id_format": 1, 144 | "id": "00435354", 145 | "id_mask": "1FFFFFFF", 146 | "data_mask": "FFFFFFFFFFFFFFFF", 147 | "data_high": "0000000000000000", 148 | "data_low": "0000000000000000" 149 | } 150 | } 151 | }, 152 | "lin_1": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | }, 158 | "lin_2": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "connect": { 165 | "wifi": { 166 | "mode": 0, 167 | "keyformat": 0, 168 | "accesspoint": [] 169 | }, 170 | "s3": { 171 | "sync": { 172 | "ota": 600, 173 | "heartbeat": 300, 174 | "logfiles": 1 175 | }, 176 | "server": {} 177 | } 178 | } 179 | } -------------------------------------------------------------------------------- /test/test_01_01/ce2_01.01_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 2, 25 | "timezone": 0, 26 | "adjustment": 0, 27 | "ntp_server": "*.pool.ntp.org", 28 | "ntp_fallback": 0, 29 | "tolerance": 30 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": [ 46 | { 47 | "name": "Ch1AllStandard", 48 | "state": 1, 49 | "type": 0, 50 | "id_format": 0, 51 | "method": 1, 52 | "f1": "7FF", 53 | "f2": "0", 54 | "prescaler": 1 55 | }, 56 | { 57 | "name": "Ch1AllExtended", 58 | "state": 1, 59 | "type": 0, 60 | "id_format": 1, 61 | "method": 1, 62 | "f1": "1FFFFFFF", 63 | "f2": "0", 64 | "prescaler": 1 65 | } 66 | ], 67 | "heartbeat": { 68 | "state": 0, 69 | "id_format": 1, 70 | "id": "00435353" 71 | }, 72 | "control": { 73 | "control_rx_state": 0, 74 | "control_tx_state": 0, 75 | "start": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0100000000000000", 81 | "data_low": "0100000000000000" 82 | }, 83 | "stop": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0000000000000000", 89 | "data_low": "0000000000000000" 90 | } 91 | } 92 | }, 93 | "can_2": { 94 | "general": { 95 | "rx_state": 1, 96 | "tx_state": 1 97 | }, 98 | "phy": { 99 | "mode": 1, 100 | "retransmission": 1, 101 | "fd_spec": 0, 102 | "bit_rate_cfg_mode": 0 103 | }, 104 | "filter": [ 105 | { 106 | "name": "Ch2AllStandard", 107 | "state": 1, 108 | "type": 0, 109 | "id_format": 0, 110 | "method": 1, 111 | "f1": "7FF", 112 | "f2": "0", 113 | "prescaler": 1 114 | }, 115 | { 116 | "name": "Ch2AllExtended", 117 | "state": 1, 118 | "type": 0, 119 | "id_format": 1, 120 | "method": 1, 121 | "f1": "1FFFFFFF", 122 | "f2": "0", 123 | "prescaler": 1 124 | } 125 | ], 126 | "heartbeat": { 127 | "state": 0, 128 | "id_format": 1, 129 | "id": "00435353" 130 | }, 131 | "control": { 132 | "control_rx_state": 0, 133 | "control_tx_state": 0, 134 | "start": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0100000000000000", 140 | "data_low": "0100000000000000" 141 | }, 142 | "stop": { 143 | "id_format": 1, 144 | "id": "00435354", 145 | "id_mask": "1FFFFFFF", 146 | "data_mask": "FFFFFFFFFFFFFFFF", 147 | "data_high": "0000000000000000", 148 | "data_low": "0000000000000000" 149 | } 150 | } 151 | }, 152 | "lin_1": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | }, 158 | "lin_2": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "connect": { 165 | "wifi": { 166 | "mode": 0, 167 | "keyformat": 0, 168 | "accesspoint": [ 169 | { 170 | "ssid": "SSID1", 171 | "pwd": "SSID1PW", 172 | "minrssi": 0 173 | } 174 | ] 175 | }, 176 | "s3": { 177 | "sync": { 178 | "ota": 600, 179 | "heartbeat": 300, 180 | "logfiles": 1 181 | }, 182 | "server": { 183 | "endpoint": "http://test.com", 184 | "port": 9000, 185 | "bucket": "bucket", 186 | "region": "eu-central-1", 187 | "accesskey": "AABBCCDDEEFF", 188 | "keyformat": 0, 189 | "secretkey": "001122334455", 190 | "signed_payload": 0 191 | } 192 | } 193 | } 194 | } -------------------------------------------------------------------------------- /test/test_01_01/test_01_01.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | 6 | class Test_01_01(TestMigrate): 7 | 8 | _simulated_devices_nof = 10 9 | 10 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 11 | [ 12 | # CANedge 1 13 | # Default to default 14 | ( 15 | CANedgeType.CANEDGE1, 16 | "fw/ce1-00.07.05.zip", 17 | "fw/ce1-01.01.01.zip", 18 | "test_01_01/ce1_00.07_1.json", 19 | "test_01_01/ce1_01.01_1.json", 20 | "config.config_func_00_07_XX_01_01_XX" 21 | ), 22 | # Non-default values in log section (which is moved to log-file) 23 | ( 24 | CANedgeType.CANEDGE1, 25 | "fw/ce1-00.07.05.zip", 26 | "fw/ce1-01.01.01.zip", 27 | "test_01_01/ce1_00.07_2.json", 28 | "test_01_01/ce1_01.01_2.json", 29 | "config.config_func_00_07_XX_01_01_XX" 30 | ), 31 | # CANedge 2 32 | # Default to default 33 | ( 34 | CANedgeType.CANEDGE2, 35 | "fw/ce2-00.07.05.zip", 36 | "fw/ce2-01.01.01.zip", 37 | "test_01_01/ce2_00.07_1.json", 38 | "test_01_01/ce2_01.01_1.json", 39 | "config.config_func_00_07_XX_01_01_XX" 40 | ), 41 | # With Wifi and S3 server. Expects that the signed_payload is set to 0 if endpoint is present 42 | ( 43 | CANedgeType.CANEDGE2, 44 | "fw/ce2-00.07.05.zip", 45 | "fw/ce2-01.01.01.zip", 46 | "test_01_01/ce2_00.07_2.json", 47 | "test_01_01/ce2_01.01_2.json", 48 | "config.config_func_00_07_XX_01_01_XX" 49 | ), 50 | ]) 51 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 52 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 53 | -------------------------------------------------------------------------------- /test/test_01_02/ce1_00.07_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power_schedule": [] 22 | }, 23 | "can_1": { 24 | "general": { 25 | "rx_state": 1, 26 | "tx_state": 1 27 | }, 28 | "phy": { 29 | "mode": 1, 30 | "retransmission": 1, 31 | "fd_spec": 0, 32 | "bit_rate_cfg_mode": 0 33 | }, 34 | "filter": [ 35 | { 36 | "name": "Ch1AllStandard", 37 | "state": 1, 38 | "type": 0, 39 | "id_format": 0, 40 | "method": 1, 41 | "f1": "7FF", 42 | "f2": "0", 43 | "prescaler": 1 44 | }, 45 | { 46 | "name": "Ch1AllExtended", 47 | "state": 1, 48 | "type": 0, 49 | "id_format": 1, 50 | "method": 1, 51 | "f1": "1FFFFFFF", 52 | "f2": "0", 53 | "prescaler": 1 54 | } 55 | ], 56 | "heartbeat": { 57 | "state": 0, 58 | "id_format": 1, 59 | "id": "00435353" 60 | }, 61 | "control": { 62 | "control_rx_state": 0, 63 | "control_tx_state": 0, 64 | "start": { 65 | "id_format": 1, 66 | "id": "00435354", 67 | "id_mask": "1FFFFFFF", 68 | "data_mask": "FFFFFFFFFFFFFFFF", 69 | "data_high": "0100000000000000", 70 | "data_low": "0100000000000000" 71 | }, 72 | "stop": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0000000000000000", 78 | "data_low": "0000000000000000" 79 | } 80 | } 81 | }, 82 | "can_2": { 83 | "general": { 84 | "rx_state": 1, 85 | "tx_state": 1 86 | }, 87 | "phy": { 88 | "mode": 1, 89 | "retransmission": 1, 90 | "fd_spec": 0, 91 | "bit_rate_cfg_mode": 0 92 | }, 93 | "filter": [ 94 | { 95 | "name": "Ch2AllStandard", 96 | "state": 1, 97 | "type": 0, 98 | "id_format": 0, 99 | "method": 1, 100 | "f1": "7FF", 101 | "f2": "0", 102 | "prescaler": 1 103 | }, 104 | { 105 | "name": "Ch2AllExtended", 106 | "state": 1, 107 | "type": 0, 108 | "id_format": 1, 109 | "method": 1, 110 | "f1": "1FFFFFFF", 111 | "f2": "0", 112 | "prescaler": 1 113 | } 114 | ], 115 | "heartbeat": { 116 | "state": 0, 117 | "id_format": 1, 118 | "id": "00435353" 119 | }, 120 | "control": { 121 | "control_rx_state": 0, 122 | "control_tx_state": 0, 123 | "start": { 124 | "id_format": 1, 125 | "id": "00435354", 126 | "id_mask": "1FFFFFFF", 127 | "data_mask": "FFFFFFFFFFFFFFFF", 128 | "data_high": "0100000000000000", 129 | "data_low": "0100000000000000" 130 | }, 131 | "stop": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0000000000000000", 137 | "data_low": "0000000000000000" 138 | } 139 | } 140 | }, 141 | "lin_1": { 142 | "phy": { 143 | "mode": 0, 144 | "bit_rate": 19200 145 | } 146 | }, 147 | "lin_2": { 148 | "phy": { 149 | "mode": 0, 150 | "bit_rate": 19200 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /test/test_01_02/ce1_00.07_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 5, 11 | "split_time_period": 120, 12 | "split_time_offset": 60, 13 | "cyclic": 0 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power_schedule": [] 22 | }, 23 | "can_1": { 24 | "general": { 25 | "rx_state": 1, 26 | "tx_state": 1 27 | }, 28 | "phy": { 29 | "mode": 1, 30 | "retransmission": 1, 31 | "fd_spec": 0, 32 | "bit_rate_cfg_mode": 0 33 | }, 34 | "filter": [ 35 | { 36 | "name": "Ch1AllStandard", 37 | "state": 1, 38 | "type": 0, 39 | "id_format": 0, 40 | "method": 1, 41 | "f1": "7FF", 42 | "f2": "0", 43 | "prescaler": 1 44 | }, 45 | { 46 | "name": "Ch1AllExtended", 47 | "state": 1, 48 | "type": 0, 49 | "id_format": 1, 50 | "method": 1, 51 | "f1": "1FFFFFFF", 52 | "f2": "0", 53 | "prescaler": 1 54 | } 55 | ], 56 | "heartbeat": { 57 | "state": 0, 58 | "id_format": 1, 59 | "id": "00435353" 60 | }, 61 | "control": { 62 | "control_rx_state": 0, 63 | "control_tx_state": 0, 64 | "start": { 65 | "id_format": 1, 66 | "id": "00435354", 67 | "id_mask": "1FFFFFFF", 68 | "data_mask": "FFFFFFFFFFFFFFFF", 69 | "data_high": "0100000000000000", 70 | "data_low": "0100000000000000" 71 | }, 72 | "stop": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0000000000000000", 78 | "data_low": "0000000000000000" 79 | } 80 | } 81 | }, 82 | "can_2": { 83 | "general": { 84 | "rx_state": 1, 85 | "tx_state": 1 86 | }, 87 | "phy": { 88 | "mode": 1, 89 | "retransmission": 1, 90 | "fd_spec": 0, 91 | "bit_rate_cfg_mode": 0 92 | }, 93 | "filter": [ 94 | { 95 | "name": "Ch2AllStandard", 96 | "state": 1, 97 | "type": 0, 98 | "id_format": 0, 99 | "method": 1, 100 | "f1": "7FF", 101 | "f2": "0", 102 | "prescaler": 1 103 | }, 104 | { 105 | "name": "Ch2AllExtended", 106 | "state": 1, 107 | "type": 0, 108 | "id_format": 1, 109 | "method": 1, 110 | "f1": "1FFFFFFF", 111 | "f2": "0", 112 | "prescaler": 1 113 | } 114 | ], 115 | "heartbeat": { 116 | "state": 0, 117 | "id_format": 1, 118 | "id": "00435353" 119 | }, 120 | "control": { 121 | "control_rx_state": 0, 122 | "control_tx_state": 0, 123 | "start": { 124 | "id_format": 1, 125 | "id": "00435354", 126 | "id_mask": "1FFFFFFF", 127 | "data_mask": "FFFFFFFFFFFFFFFF", 128 | "data_high": "0100000000000000", 129 | "data_low": "0100000000000000" 130 | }, 131 | "stop": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0000000000000000", 137 | "data_low": "0000000000000000" 138 | } 139 | } 140 | }, 141 | "lin_1": { 142 | "phy": { 143 | "mode": 0, 144 | "bit_rate": 19200 145 | } 146 | }, 147 | "lin_2": { 148 | "phy": { 149 | "mode": 0, 150 | "bit_rate": 19200 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /test/test_01_02/ce1_00.07_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 0, 17 | "timezone": 0, 18 | "adjustment": 0 19 | }, 20 | "secondaryport": { 21 | "power_schedule": [] 22 | }, 23 | "can_1": { 24 | "general": { 25 | "rx_state": 1, 26 | "tx_state": 1 27 | }, 28 | "phy": { 29 | "mode": 1, 30 | "retransmission": 1, 31 | "fd_spec": 0, 32 | "bit_rate_cfg_mode": 0 33 | }, 34 | "filter": [ 35 | { 36 | "name": "1", 37 | "state": 1, 38 | "type": 0, 39 | "id_format": 0, 40 | "method": 1, 41 | "f1": "7FF", 42 | "f2": "0" 43 | }, 44 | { 45 | "name": "2", 46 | "state": 1, 47 | "type": 0, 48 | "id_format": 1, 49 | "method": 1, 50 | "f1": "1FFFFFFF", 51 | "f2": "0", 52 | "prescaler": 0 53 | }, 54 | { 55 | "name": "3", 56 | "state": 1, 57 | "type": 0, 58 | "id_format": 1, 59 | "method": 1, 60 | "f1": "1FFFFFFF", 61 | "f2": "0", 62 | "prescaler": 1 63 | }, 64 | { 65 | "name": "4", 66 | "state": 1, 67 | "type": 0, 68 | "id_format": 1, 69 | "method": 1, 70 | "f1": "1FFFFFFF", 71 | "f2": "0", 72 | "prescaler": 100 73 | } 74 | ], 75 | "heartbeat": { 76 | "state": 0, 77 | "id_format": 1, 78 | "id": "00435353" 79 | }, 80 | "control": { 81 | "control_rx_state": 0, 82 | "control_tx_state": 0, 83 | "start": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0100000000000000", 89 | "data_low": "0100000000000000" 90 | }, 91 | "stop": { 92 | "id_format": 1, 93 | "id": "00435354", 94 | "id_mask": "1FFFFFFF", 95 | "data_mask": "FFFFFFFFFFFFFFFF", 96 | "data_high": "0000000000000000", 97 | "data_low": "0000000000000000" 98 | } 99 | } 100 | }, 101 | "can_2": { 102 | "general": { 103 | "rx_state": 1, 104 | "tx_state": 1 105 | }, 106 | "phy": { 107 | "mode": 1, 108 | "retransmission": 1, 109 | "fd_spec": 0, 110 | "bit_rate_cfg_mode": 0 111 | }, 112 | "filter": [ 113 | { 114 | "name": "1", 115 | "state": 1, 116 | "type": 0, 117 | "id_format": 0, 118 | "method": 1, 119 | "f1": "7FF", 120 | "f2": "0" 121 | }, 122 | { 123 | "name": "2", 124 | "state": 1, 125 | "type": 0, 126 | "id_format": 1, 127 | "method": 1, 128 | "f1": "1FFFFFFF", 129 | "f2": "0", 130 | "prescaler": 0 131 | }, 132 | { 133 | "name": "3", 134 | "state": 1, 135 | "type": 0, 136 | "id_format": 1, 137 | "method": 1, 138 | "f1": "1FFFFFFF", 139 | "f2": "0", 140 | "prescaler": 1 141 | }, 142 | { 143 | "name": "4", 144 | "state": 1, 145 | "type": 0, 146 | "id_format": 1, 147 | "method": 1, 148 | "f1": "1FFFFFFF", 149 | "f2": "0", 150 | "prescaler": 100 151 | } 152 | ], 153 | "heartbeat": { 154 | "state": 0, 155 | "id_format": 1, 156 | "id": "00435353" 157 | }, 158 | "control": { 159 | "control_rx_state": 0, 160 | "control_tx_state": 0, 161 | "start": { 162 | "id_format": 1, 163 | "id": "00435354", 164 | "id_mask": "1FFFFFFF", 165 | "data_mask": "FFFFFFFFFFFFFFFF", 166 | "data_high": "0100000000000000", 167 | "data_low": "0100000000000000" 168 | }, 169 | "stop": { 170 | "id_format": 1, 171 | "id": "00435354", 172 | "id_mask": "1FFFFFFF", 173 | "data_mask": "FFFFFFFFFFFFFFFF", 174 | "data_high": "0000000000000000", 175 | "data_low": "0000000000000000" 176 | } 177 | } 178 | }, 179 | "lin_1": { 180 | "phy": { 181 | "mode": 0, 182 | "bit_rate": 19200 183 | } 184 | }, 185 | "lin_2": { 186 | "phy": { 187 | "mode": 0, 188 | "bit_rate": 19200 189 | } 190 | } 191 | } -------------------------------------------------------------------------------- /test/test_01_02/ce1_01.02_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler_type": 0 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler_type": 0 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler_type": 0 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler_type": 0 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /test/test_01_02/ce1_01.02_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 5, 12 | "split_time_period": 120, 13 | "split_time_offset": 60, 14 | "cyclic": 0 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler_type": 0 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler_type": 0 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler_type": 0 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler_type": 0 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /test/test_01_02/ce2_00.07_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "secondaryport": { 24 | "power_schedule": [] 25 | }, 26 | "can_1": { 27 | "general": { 28 | "rx_state": 1, 29 | "tx_state": 1 30 | }, 31 | "phy": { 32 | "mode": 1, 33 | "retransmission": 1, 34 | "fd_spec": 0, 35 | "bit_rate_cfg_mode": 0 36 | }, 37 | "filter": [ 38 | { 39 | "name": "Ch1AllStandard", 40 | "state": 1, 41 | "type": 0, 42 | "id_format": 0, 43 | "method": 1, 44 | "f1": "7FF", 45 | "f2": "0", 46 | "prescaler": 1 47 | }, 48 | { 49 | "name": "Ch1AllExtended", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 1, 53 | "method": 1, 54 | "f1": "1FFFFFFF", 55 | "f2": "0", 56 | "prescaler": 1 57 | } 58 | ], 59 | "heartbeat": { 60 | "state": 0, 61 | "id_format": 1, 62 | "id": "00435353" 63 | }, 64 | "control": { 65 | "control_rx_state": 0, 66 | "control_tx_state": 0, 67 | "start": { 68 | "id_format": 1, 69 | "id": "00435354", 70 | "id_mask": "1FFFFFFF", 71 | "data_mask": "FFFFFFFFFFFFFFFF", 72 | "data_high": "0100000000000000", 73 | "data_low": "0100000000000000" 74 | }, 75 | "stop": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0000000000000000", 81 | "data_low": "0000000000000000" 82 | } 83 | } 84 | }, 85 | "can_2": { 86 | "general": { 87 | "rx_state": 1, 88 | "tx_state": 1 89 | }, 90 | "phy": { 91 | "mode": 1, 92 | "retransmission": 1, 93 | "fd_spec": 0, 94 | "bit_rate_cfg_mode": 0 95 | }, 96 | "filter": [ 97 | { 98 | "name": "Ch2AllStandard", 99 | "state": 1, 100 | "type": 0, 101 | "id_format": 0, 102 | "method": 1, 103 | "f1": "7FF", 104 | "f2": "0", 105 | "prescaler": 1 106 | }, 107 | { 108 | "name": "Ch2AllExtended", 109 | "state": 1, 110 | "type": 0, 111 | "id_format": 1, 112 | "method": 1, 113 | "f1": "1FFFFFFF", 114 | "f2": "0", 115 | "prescaler": 1 116 | } 117 | ], 118 | "heartbeat": { 119 | "state": 0, 120 | "id_format": 1, 121 | "id": "00435353" 122 | }, 123 | "control": { 124 | "control_rx_state": 0, 125 | "control_tx_state": 0, 126 | "start": { 127 | "id_format": 1, 128 | "id": "00435354", 129 | "id_mask": "1FFFFFFF", 130 | "data_mask": "FFFFFFFFFFFFFFFF", 131 | "data_high": "0100000000000000", 132 | "data_low": "0100000000000000" 133 | }, 134 | "stop": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0000000000000000", 140 | "data_low": "0000000000000000" 141 | } 142 | } 143 | }, 144 | "lin_1": { 145 | "phy": { 146 | "mode": 0, 147 | "bit_rate": 19200 148 | } 149 | }, 150 | "lin_2": { 151 | "phy": { 152 | "mode": 0, 153 | "bit_rate": 19200 154 | } 155 | }, 156 | "connect": { 157 | "wifi": { 158 | "mode": 0, 159 | "keyformat": 0, 160 | "accesspoint": [] 161 | }, 162 | "s3": { 163 | "sync": { 164 | "ota": 600, 165 | "heartbeat": 300, 166 | "logfiles": 1 167 | }, 168 | "server": {} 169 | } 170 | } 171 | } -------------------------------------------------------------------------------- /test/test_01_02/ce2_00.07_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "split_size": 50, 11 | "split_time_period": 0, 12 | "split_time_offset": 0, 13 | "cyclic": 1 14 | }, 15 | "rtc": { 16 | "sync": 2, 17 | "timezone": 0, 18 | "adjustment": 0, 19 | "ntp_server": "*.pool.ntp.org", 20 | "ntp_fallback": 0, 21 | "tolerance": 30 22 | }, 23 | "secondaryport": { 24 | "power_schedule": [] 25 | }, 26 | "can_1": { 27 | "general": { 28 | "rx_state": 1, 29 | "tx_state": 1 30 | }, 31 | "phy": { 32 | "mode": 1, 33 | "retransmission": 1, 34 | "fd_spec": 0, 35 | "bit_rate_cfg_mode": 0 36 | }, 37 | "filter": [ 38 | { 39 | "name": "Ch1AllStandard", 40 | "state": 1, 41 | "type": 0, 42 | "id_format": 0, 43 | "method": 1, 44 | "f1": "7FF", 45 | "f2": "0", 46 | "prescaler": 1 47 | }, 48 | { 49 | "name": "Ch1AllExtended", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 1, 53 | "method": 1, 54 | "f1": "1FFFFFFF", 55 | "f2": "0", 56 | "prescaler": 1 57 | } 58 | ], 59 | "heartbeat": { 60 | "state": 0, 61 | "id_format": 1, 62 | "id": "00435353" 63 | }, 64 | "control": { 65 | "control_rx_state": 0, 66 | "control_tx_state": 0, 67 | "start": { 68 | "id_format": 1, 69 | "id": "00435354", 70 | "id_mask": "1FFFFFFF", 71 | "data_mask": "FFFFFFFFFFFFFFFF", 72 | "data_high": "0100000000000000", 73 | "data_low": "0100000000000000" 74 | }, 75 | "stop": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0000000000000000", 81 | "data_low": "0000000000000000" 82 | } 83 | } 84 | }, 85 | "can_2": { 86 | "general": { 87 | "rx_state": 1, 88 | "tx_state": 1 89 | }, 90 | "phy": { 91 | "mode": 1, 92 | "retransmission": 1, 93 | "fd_spec": 0, 94 | "bit_rate_cfg_mode": 0 95 | }, 96 | "filter": [ 97 | { 98 | "name": "Ch2AllStandard", 99 | "state": 1, 100 | "type": 0, 101 | "id_format": 0, 102 | "method": 1, 103 | "f1": "7FF", 104 | "f2": "0", 105 | "prescaler": 1 106 | }, 107 | { 108 | "name": "Ch2AllExtended", 109 | "state": 1, 110 | "type": 0, 111 | "id_format": 1, 112 | "method": 1, 113 | "f1": "1FFFFFFF", 114 | "f2": "0", 115 | "prescaler": 1 116 | } 117 | ], 118 | "heartbeat": { 119 | "state": 0, 120 | "id_format": 1, 121 | "id": "00435353" 122 | }, 123 | "control": { 124 | "control_rx_state": 0, 125 | "control_tx_state": 0, 126 | "start": { 127 | "id_format": 1, 128 | "id": "00435354", 129 | "id_mask": "1FFFFFFF", 130 | "data_mask": "FFFFFFFFFFFFFFFF", 131 | "data_high": "0100000000000000", 132 | "data_low": "0100000000000000" 133 | }, 134 | "stop": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0000000000000000", 140 | "data_low": "0000000000000000" 141 | } 142 | } 143 | }, 144 | "lin_1": { 145 | "phy": { 146 | "mode": 0, 147 | "bit_rate": 19200 148 | } 149 | }, 150 | "lin_2": { 151 | "phy": { 152 | "mode": 0, 153 | "bit_rate": 19200 154 | } 155 | }, 156 | "connect": { 157 | "wifi": { 158 | "mode": 0, 159 | "keyformat": 0, 160 | "accesspoint": [ 161 | { 162 | "ssid": "SSID1", 163 | "pwd": "SSID1PW", 164 | "minrssi": 0 165 | } 166 | ] 167 | }, 168 | "s3": { 169 | "sync": { 170 | "ota": 600, 171 | "heartbeat": 300, 172 | "logfiles": 1 173 | }, 174 | "server": { 175 | "endpoint": "http://test.com", 176 | "port": 9000, 177 | "bucket": "bucket", 178 | "region": "eu-central-1", 179 | "accesskey": "AABBCCDDEEFF", 180 | "keyformat": 0, 181 | "secretkey": "001122334455" 182 | } 183 | } 184 | } 185 | } -------------------------------------------------------------------------------- /test/test_01_02/ce2_01.02_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 2, 25 | "timezone": 0, 26 | "adjustment": 0, 27 | "ntp_server": "*.pool.ntp.org", 28 | "ntp_fallback": 0, 29 | "tolerance": 30 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": [ 46 | { 47 | "name": "Ch1AllStandard", 48 | "state": 1, 49 | "type": 0, 50 | "id_format": 0, 51 | "method": 1, 52 | "f1": "7FF", 53 | "f2": "0", 54 | "prescaler_type": 0 55 | }, 56 | { 57 | "name": "Ch1AllExtended", 58 | "state": 1, 59 | "type": 0, 60 | "id_format": 1, 61 | "method": 1, 62 | "f1": "1FFFFFFF", 63 | "f2": "0", 64 | "prescaler_type": 0 65 | } 66 | ], 67 | "heartbeat": { 68 | "state": 0, 69 | "id_format": 1, 70 | "id": "00435353" 71 | }, 72 | "control": { 73 | "control_rx_state": 0, 74 | "control_tx_state": 0, 75 | "start": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0100000000000000", 81 | "data_low": "0100000000000000" 82 | }, 83 | "stop": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0000000000000000", 89 | "data_low": "0000000000000000" 90 | } 91 | } 92 | }, 93 | "can_2": { 94 | "general": { 95 | "rx_state": 1, 96 | "tx_state": 1 97 | }, 98 | "phy": { 99 | "mode": 1, 100 | "retransmission": 1, 101 | "fd_spec": 0, 102 | "bit_rate_cfg_mode": 0 103 | }, 104 | "filter": [ 105 | { 106 | "name": "Ch2AllStandard", 107 | "state": 1, 108 | "type": 0, 109 | "id_format": 0, 110 | "method": 1, 111 | "f1": "7FF", 112 | "f2": "0", 113 | "prescaler_type": 0 114 | }, 115 | { 116 | "name": "Ch2AllExtended", 117 | "state": 1, 118 | "type": 0, 119 | "id_format": 1, 120 | "method": 1, 121 | "f1": "1FFFFFFF", 122 | "f2": "0", 123 | "prescaler_type": 0 124 | } 125 | ], 126 | "heartbeat": { 127 | "state": 0, 128 | "id_format": 1, 129 | "id": "00435353" 130 | }, 131 | "control": { 132 | "control_rx_state": 0, 133 | "control_tx_state": 0, 134 | "start": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0100000000000000", 140 | "data_low": "0100000000000000" 141 | }, 142 | "stop": { 143 | "id_format": 1, 144 | "id": "00435354", 145 | "id_mask": "1FFFFFFF", 146 | "data_mask": "FFFFFFFFFFFFFFFF", 147 | "data_high": "0000000000000000", 148 | "data_low": "0000000000000000" 149 | } 150 | } 151 | }, 152 | "lin_1": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | }, 158 | "lin_2": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "connect": { 165 | "wifi": { 166 | "mode": 0, 167 | "keyformat": 0, 168 | "accesspoint": [] 169 | }, 170 | "s3": { 171 | "sync": { 172 | "ota": 600, 173 | "heartbeat": 300, 174 | "logfiles": 1 175 | }, 176 | "server": {} 177 | } 178 | } 179 | } -------------------------------------------------------------------------------- /test/test_01_02/ce2_01.02_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 2, 25 | "timezone": 0, 26 | "adjustment": 0, 27 | "ntp_server": "*.pool.ntp.org", 28 | "ntp_fallback": 0, 29 | "tolerance": 30 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": [ 46 | { 47 | "name": "Ch1AllStandard", 48 | "state": 1, 49 | "type": 0, 50 | "id_format": 0, 51 | "method": 1, 52 | "f1": "7FF", 53 | "f2": "0", 54 | "prescaler_type": 0 55 | }, 56 | { 57 | "name": "Ch1AllExtended", 58 | "state": 1, 59 | "type": 0, 60 | "id_format": 1, 61 | "method": 1, 62 | "f1": "1FFFFFFF", 63 | "f2": "0", 64 | "prescaler_type": 0 65 | } 66 | ], 67 | "heartbeat": { 68 | "state": 0, 69 | "id_format": 1, 70 | "id": "00435353" 71 | }, 72 | "control": { 73 | "control_rx_state": 0, 74 | "control_tx_state": 0, 75 | "start": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0100000000000000", 81 | "data_low": "0100000000000000" 82 | }, 83 | "stop": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0000000000000000", 89 | "data_low": "0000000000000000" 90 | } 91 | } 92 | }, 93 | "can_2": { 94 | "general": { 95 | "rx_state": 1, 96 | "tx_state": 1 97 | }, 98 | "phy": { 99 | "mode": 1, 100 | "retransmission": 1, 101 | "fd_spec": 0, 102 | "bit_rate_cfg_mode": 0 103 | }, 104 | "filter": [ 105 | { 106 | "name": "Ch2AllStandard", 107 | "state": 1, 108 | "type": 0, 109 | "id_format": 0, 110 | "method": 1, 111 | "f1": "7FF", 112 | "f2": "0", 113 | "prescaler_type": 0 114 | }, 115 | { 116 | "name": "Ch2AllExtended", 117 | "state": 1, 118 | "type": 0, 119 | "id_format": 1, 120 | "method": 1, 121 | "f1": "1FFFFFFF", 122 | "f2": "0", 123 | "prescaler_type": 0 124 | } 125 | ], 126 | "heartbeat": { 127 | "state": 0, 128 | "id_format": 1, 129 | "id": "00435353" 130 | }, 131 | "control": { 132 | "control_rx_state": 0, 133 | "control_tx_state": 0, 134 | "start": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0100000000000000", 140 | "data_low": "0100000000000000" 141 | }, 142 | "stop": { 143 | "id_format": 1, 144 | "id": "00435354", 145 | "id_mask": "1FFFFFFF", 146 | "data_mask": "FFFFFFFFFFFFFFFF", 147 | "data_high": "0000000000000000", 148 | "data_low": "0000000000000000" 149 | } 150 | } 151 | }, 152 | "lin_1": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | }, 158 | "lin_2": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "connect": { 165 | "wifi": { 166 | "mode": 0, 167 | "keyformat": 0, 168 | "accesspoint": [ 169 | { 170 | "ssid": "SSID1", 171 | "pwd": "SSID1PW", 172 | "minrssi": 0 173 | } 174 | ] 175 | }, 176 | "s3": { 177 | "sync": { 178 | "ota": 600, 179 | "heartbeat": 300, 180 | "logfiles": 1 181 | }, 182 | "server": { 183 | "endpoint": "http://test.com", 184 | "port": 9000, 185 | "bucket": "bucket", 186 | "region": "eu-central-1", 187 | "accesskey": "AABBCCDDEEFF", 188 | "keyformat": 0, 189 | "secretkey": "001122334455", 190 | "signed_payload": 0 191 | } 192 | } 193 | } 194 | } -------------------------------------------------------------------------------- /test/test_01_02/test_01_02.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | 6 | class Test_01_02(TestMigrate): 7 | 8 | _simulated_devices_nof = 10 9 | 10 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 11 | [ 12 | # CANedge 1 13 | # Default to default 14 | ( 15 | CANedgeType.CANEDGE1, 16 | "fw/ce1-00.07.05.zip", 17 | "fw/ce1-01.02.05.zip", 18 | "test_01_02/ce1_00.07_1.json", 19 | "test_01_02/ce1_01.02_1.json", 20 | "config.config_func_00_07_XX_01_02_XX" 21 | ), 22 | # Non-default values in log section (which is moved to log-file) 23 | ( 24 | CANedgeType.CANEDGE1, 25 | "fw/ce1-00.07.05.zip", 26 | "fw/ce1-01.02.05.zip", 27 | "test_01_02/ce1_00.07_2.json", 28 | "test_01_02/ce1_01.02_2.json", 29 | "config.config_func_00_07_XX_01_02_XX" 30 | ), 31 | # Migrate filter with prescaling 32 | ( 33 | CANedgeType.CANEDGE1, 34 | "fw/ce1-00.07.05.zip", 35 | "fw/ce1-01.02.05.zip", 36 | "test_01_02/ce1_00.07_3.json", 37 | "test_01_02/ce1_01.02_3.json", 38 | "config.config_func_00_07_XX_01_02_XX" 39 | ), 40 | # CANedge 2 41 | # Default to default 42 | ( 43 | CANedgeType.CANEDGE2, 44 | "fw/ce2-00.07.05.zip", 45 | "fw/ce2-01.02.05.zip", 46 | "test_01_02/ce2_00.07_1.json", 47 | "test_01_02/ce2_01.02_1.json", 48 | "config.config_func_00_07_XX_01_02_XX" 49 | ), 50 | # With Wifi and S3 server. Expects that the signed_payload is set to 0 if endpoint is present 51 | ( 52 | CANedgeType.CANEDGE2, 53 | "fw/ce2-00.07.05.zip", 54 | "fw/ce2-01.02.05.zip", 55 | "test_01_02/ce2_00.07_2.json", 56 | "test_01_02/ce2_01.02_2.json", 57 | "config.config_func_00_07_XX_01_02_XX" 58 | ), 59 | ]) 60 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 61 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 62 | -------------------------------------------------------------------------------- /test/test_01_03/ce1_01.02_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler_type": 0 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler_type": 0 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler_type": 0 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler_type": 0 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /test/test_01_03/ce1_01.03_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler_type": 0 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler_type": 0 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler_type": 0 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler_type": 0 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /test/test_01_03/ce2_01.02_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 2, 25 | "timezone": 0, 26 | "adjustment": 0, 27 | "ntp_server": "*.pool.ntp.org", 28 | "ntp_fallback": 0, 29 | "tolerance": 30 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": [ 46 | { 47 | "name": "Ch1AllStandard", 48 | "state": 1, 49 | "type": 0, 50 | "id_format": 0, 51 | "method": 1, 52 | "f1": "7FF", 53 | "f2": "0", 54 | "prescaler_type": 0 55 | }, 56 | { 57 | "name": "Ch1AllExtended", 58 | "state": 1, 59 | "type": 0, 60 | "id_format": 1, 61 | "method": 1, 62 | "f1": "1FFFFFFF", 63 | "f2": "0", 64 | "prescaler_type": 0 65 | } 66 | ], 67 | "heartbeat": { 68 | "state": 0, 69 | "id_format": 1, 70 | "id": "00435353" 71 | }, 72 | "control": { 73 | "control_rx_state": 0, 74 | "control_tx_state": 0, 75 | "start": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0100000000000000", 81 | "data_low": "0100000000000000" 82 | }, 83 | "stop": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0000000000000000", 89 | "data_low": "0000000000000000" 90 | } 91 | } 92 | }, 93 | "can_2": { 94 | "general": { 95 | "rx_state": 1, 96 | "tx_state": 1 97 | }, 98 | "phy": { 99 | "mode": 1, 100 | "retransmission": 1, 101 | "fd_spec": 0, 102 | "bit_rate_cfg_mode": 0 103 | }, 104 | "filter": [ 105 | { 106 | "name": "Ch2AllStandard", 107 | "state": 1, 108 | "type": 0, 109 | "id_format": 0, 110 | "method": 1, 111 | "f1": "7FF", 112 | "f2": "0", 113 | "prescaler_type": 0 114 | }, 115 | { 116 | "name": "Ch2AllExtended", 117 | "state": 1, 118 | "type": 0, 119 | "id_format": 1, 120 | "method": 1, 121 | "f1": "1FFFFFFF", 122 | "f2": "0", 123 | "prescaler_type": 0 124 | } 125 | ], 126 | "heartbeat": { 127 | "state": 0, 128 | "id_format": 1, 129 | "id": "00435353" 130 | }, 131 | "control": { 132 | "control_rx_state": 0, 133 | "control_tx_state": 0, 134 | "start": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0100000000000000", 140 | "data_low": "0100000000000000" 141 | }, 142 | "stop": { 143 | "id_format": 1, 144 | "id": "00435354", 145 | "id_mask": "1FFFFFFF", 146 | "data_mask": "FFFFFFFFFFFFFFFF", 147 | "data_high": "0000000000000000", 148 | "data_low": "0000000000000000" 149 | } 150 | } 151 | }, 152 | "lin_1": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | }, 158 | "lin_2": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "connect": { 165 | "wifi": { 166 | "mode": 0, 167 | "keyformat": 0, 168 | "accesspoint": [] 169 | }, 170 | "s3": { 171 | "sync": { 172 | "ota": 600, 173 | "heartbeat": 300, 174 | "logfiles": 1 175 | }, 176 | "server": {} 177 | } 178 | } 179 | } -------------------------------------------------------------------------------- /test/test_01_03/ce2_01.03_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 2, 25 | "timezone": 0, 26 | "adjustment": 0, 27 | "ntp_server": "*.pool.ntp.org", 28 | "ntp_fallback": 0, 29 | "tolerance": 30 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": [ 46 | { 47 | "name": "Ch1AllStandard", 48 | "state": 1, 49 | "type": 0, 50 | "id_format": 0, 51 | "method": 1, 52 | "f1": "7FF", 53 | "f2": "0", 54 | "prescaler_type": 0 55 | }, 56 | { 57 | "name": "Ch1AllExtended", 58 | "state": 1, 59 | "type": 0, 60 | "id_format": 1, 61 | "method": 1, 62 | "f1": "1FFFFFFF", 63 | "f2": "0", 64 | "prescaler_type": 0 65 | } 66 | ], 67 | "heartbeat": { 68 | "state": 0, 69 | "id_format": 1, 70 | "id": "00435353" 71 | }, 72 | "control": { 73 | "control_rx_state": 0, 74 | "control_tx_state": 0, 75 | "start": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0100000000000000", 81 | "data_low": "0100000000000000" 82 | }, 83 | "stop": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0000000000000000", 89 | "data_low": "0000000000000000" 90 | } 91 | } 92 | }, 93 | "can_2": { 94 | "general": { 95 | "rx_state": 1, 96 | "tx_state": 1 97 | }, 98 | "phy": { 99 | "mode": 1, 100 | "retransmission": 1, 101 | "fd_spec": 0, 102 | "bit_rate_cfg_mode": 0 103 | }, 104 | "filter": [ 105 | { 106 | "name": "Ch2AllStandard", 107 | "state": 1, 108 | "type": 0, 109 | "id_format": 0, 110 | "method": 1, 111 | "f1": "7FF", 112 | "f2": "0", 113 | "prescaler_type": 0 114 | }, 115 | { 116 | "name": "Ch2AllExtended", 117 | "state": 1, 118 | "type": 0, 119 | "id_format": 1, 120 | "method": 1, 121 | "f1": "1FFFFFFF", 122 | "f2": "0", 123 | "prescaler_type": 0 124 | } 125 | ], 126 | "heartbeat": { 127 | "state": 0, 128 | "id_format": 1, 129 | "id": "00435353" 130 | }, 131 | "control": { 132 | "control_rx_state": 0, 133 | "control_tx_state": 0, 134 | "start": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0100000000000000", 140 | "data_low": "0100000000000000" 141 | }, 142 | "stop": { 143 | "id_format": 1, 144 | "id": "00435354", 145 | "id_mask": "1FFFFFFF", 146 | "data_mask": "FFFFFFFFFFFFFFFF", 147 | "data_high": "0000000000000000", 148 | "data_low": "0000000000000000" 149 | } 150 | } 151 | }, 152 | "lin_1": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | }, 158 | "lin_2": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "connect": { 165 | "wifi": { 166 | "mode": 0, 167 | "keyformat": 0, 168 | "accesspoint": [] 169 | }, 170 | "s3": { 171 | "sync": { 172 | "ota": 600, 173 | "heartbeat": 300, 174 | "logfiles": 1 175 | }, 176 | "server": {} 177 | } 178 | } 179 | } -------------------------------------------------------------------------------- /test/test_01_03/test_01_03.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | 6 | class Test_01_03(TestMigrate): 7 | 8 | _simulated_devices_nof = 10 9 | 10 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 11 | [ 12 | # CANedge 1 13 | # Default to default 14 | ( 15 | CANedgeType.CANEDGE1, 16 | "fw/ce1-01.02.05.zip", 17 | "fw/ce1-01.03.01.zip", 18 | "test_01_03/ce1_01.02_1.json", 19 | "test_01_03/ce1_01.03_1.json", 20 | "config.config_func_01_02_XX_01_03_XX" 21 | ), 22 | # CANedge 2 23 | # Default to default 24 | ( 25 | CANedgeType.CANEDGE2, 26 | "fw/ce2-01.02.05.zip", 27 | "fw/ce2-01.03.01.zip", 28 | "test_01_03/ce2_01.02_1.json", 29 | "test_01_03/ce2_01.03_1.json", 30 | "config.config_func_01_02_XX_01_03_XX" 31 | ), 32 | # Set request_style 33 | ( 34 | CANedgeType.CANEDGE2, 35 | "fw/ce2-01.02.05.zip", 36 | "fw/ce2-01.03.01.zip", 37 | "test_01_03/ce2_01.02_2.json", 38 | "test_01_03/ce2_01.03_2.json", 39 | "config.config_func_01_02_XX_01_03_XX" 40 | ), 41 | 42 | ]) 43 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 44 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 45 | -------------------------------------------------------------------------------- /test/test_01_04/ce1_01.03_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler_type": 0 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler_type": 0 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler_type": 0 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler_type": 0 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | }, 149 | "lin_1": { 150 | "phy": { 151 | "mode": 0, 152 | "bit_rate": 19200 153 | } 154 | }, 155 | "lin_2": { 156 | "phy": { 157 | "mode": 0, 158 | "bit_rate": 19200 159 | } 160 | } 161 | } -------------------------------------------------------------------------------- /test/test_01_04/ce1_01.03_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 0, 25 | "timezone": 0, 26 | "adjustment": 0 27 | }, 28 | "secondaryport": { 29 | "power_schedule": [] 30 | }, 31 | "can_1": { 32 | "general": { 33 | "rx_state": 1, 34 | "tx_state": 1 35 | }, 36 | "phy": { 37 | "mode": 1, 38 | "retransmission": 1, 39 | "fd_spec": 0, 40 | "bit_rate_cfg_mode": 0 41 | }, 42 | "filter": [ 43 | { 44 | "name": "Ch1AllStandard", 45 | "state": 1, 46 | "type": 0, 47 | "id_format": 0, 48 | "method": 1, 49 | "f1": "7FF", 50 | "f2": "0", 51 | "prescaler_type": 0 52 | }, 53 | { 54 | "name": "Ch1AllExtended", 55 | "state": 1, 56 | "type": 0, 57 | "id_format": 1, 58 | "method": 1, 59 | "f1": "1FFFFFFF", 60 | "f2": "0", 61 | "prescaler_type": 0 62 | } 63 | ], 64 | "heartbeat": { 65 | "state": 0, 66 | "id_format": 1, 67 | "id": "00435353" 68 | }, 69 | "control": { 70 | "control_rx_state": 0, 71 | "control_tx_state": 0, 72 | "start": { 73 | "id_format": 1, 74 | "id": "00435354", 75 | "id_mask": "1FFFFFFF", 76 | "data_mask": "FFFFFFFFFFFFFFFF", 77 | "data_high": "0100000000000000", 78 | "data_low": "0100000000000000" 79 | }, 80 | "stop": { 81 | "id_format": 1, 82 | "id": "00435354", 83 | "id_mask": "1FFFFFFF", 84 | "data_mask": "FFFFFFFFFFFFFFFF", 85 | "data_high": "0000000000000000", 86 | "data_low": "0000000000000000" 87 | } 88 | } 89 | }, 90 | "can_2": { 91 | "general": { 92 | "rx_state": 1, 93 | "tx_state": 1 94 | }, 95 | "phy": { 96 | "mode": 1, 97 | "retransmission": 1, 98 | "fd_spec": 0, 99 | "bit_rate_cfg_mode": 0 100 | }, 101 | "filter": [ 102 | { 103 | "name": "Ch2AllStandard", 104 | "state": 1, 105 | "type": 0, 106 | "id_format": 0, 107 | "method": 1, 108 | "f1": "7FF", 109 | "f2": "0", 110 | "prescaler_type": 0 111 | }, 112 | { 113 | "name": "Ch2AllExtended", 114 | "state": 1, 115 | "type": 0, 116 | "id_format": 1, 117 | "method": 1, 118 | "f1": "1FFFFFFF", 119 | "f2": "0", 120 | "prescaler_type": 0 121 | } 122 | ], 123 | "heartbeat": { 124 | "state": 0, 125 | "id_format": 1, 126 | "id": "00435353" 127 | }, 128 | "control": { 129 | "control_rx_state": 0, 130 | "control_tx_state": 0, 131 | "start": { 132 | "id_format": 1, 133 | "id": "00435354", 134 | "id_mask": "1FFFFFFF", 135 | "data_mask": "FFFFFFFFFFFFFFFF", 136 | "data_high": "0100000000000000", 137 | "data_low": "0100000000000000" 138 | }, 139 | "stop": { 140 | "id_format": 1, 141 | "id": "00435354", 142 | "id_mask": "1FFFFFFF", 143 | "data_mask": "FFFFFFFFFFFFFFFF", 144 | "data_high": "0000000000000000", 145 | "data_low": "0000000000000000" 146 | } 147 | } 148 | } 149 | } -------------------------------------------------------------------------------- /test/test_01_04/ce1_01.04_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 0, 28 | "timezone": 0, 29 | "adjustment": 0 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": { 46 | "remote_frames": 0, 47 | "id": [ 48 | { 49 | "name": "Ch1AllStandard", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 0, 53 | "method": 1, 54 | "f1": "7FF", 55 | "f2": "0", 56 | "prescaler_type": 0 57 | }, 58 | { 59 | "name": "Ch1AllExtended", 60 | "state": 1, 61 | "type": 0, 62 | "id_format": 1, 63 | "method": 1, 64 | "f1": "1FFFFFFF", 65 | "f2": "0", 66 | "prescaler_type": 0 67 | } 68 | ] 69 | }, 70 | "heartbeat": { 71 | "state": 0, 72 | "id_format": 1, 73 | "id": "00435353" 74 | }, 75 | "control": { 76 | "control_rx_state": 0, 77 | "control_tx_state": 0, 78 | "start": { 79 | "id_format": 1, 80 | "id": "00435354", 81 | "id_mask": "1FFFFFFF", 82 | "data_mask": "FFFFFFFFFFFFFFFF", 83 | "data_high": "0100000000000000", 84 | "data_low": "0100000000000000" 85 | }, 86 | "stop": { 87 | "id_format": 1, 88 | "id": "00435354", 89 | "id_mask": "1FFFFFFF", 90 | "data_mask": "FFFFFFFFFFFFFFFF", 91 | "data_high": "0000000000000000", 92 | "data_low": "0000000000000000" 93 | } 94 | } 95 | }, 96 | "can_2": { 97 | "general": { 98 | "rx_state": 1, 99 | "tx_state": 1 100 | }, 101 | "phy": { 102 | "mode": 1, 103 | "retransmission": 1, 104 | "fd_spec": 0, 105 | "bit_rate_cfg_mode": 0 106 | }, 107 | "filter": { 108 | "remote_frames": 0, 109 | "id": [ 110 | { 111 | "name": "Ch2AllStandard", 112 | "state": 1, 113 | "type": 0, 114 | "id_format": 0, 115 | "method": 1, 116 | "f1": "7FF", 117 | "f2": "0", 118 | "prescaler_type": 0 119 | }, 120 | { 121 | "name": "Ch2AllExtended", 122 | "state": 1, 123 | "type": 0, 124 | "id_format": 1, 125 | "method": 1, 126 | "f1": "1FFFFFFF", 127 | "f2": "0", 128 | "prescaler_type": 0 129 | } 130 | ] 131 | }, 132 | "heartbeat": { 133 | "state": 0, 134 | "id_format": 1, 135 | "id": "00435353" 136 | }, 137 | "control": { 138 | "control_rx_state": 0, 139 | "control_tx_state": 0, 140 | "start": { 141 | "id_format": 1, 142 | "id": "00435354", 143 | "id_mask": "1FFFFFFF", 144 | "data_mask": "FFFFFFFFFFFFFFFF", 145 | "data_high": "0100000000000000", 146 | "data_low": "0100000000000000" 147 | }, 148 | "stop": { 149 | "id_format": 1, 150 | "id": "00435354", 151 | "id_mask": "1FFFFFFF", 152 | "data_mask": "FFFFFFFFFFFFFFFF", 153 | "data_high": "0000000000000000", 154 | "data_low": "0000000000000000" 155 | } 156 | } 157 | }, 158 | "lin_1": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "lin_2": { 165 | "phy": { 166 | "mode": 0, 167 | "bit_rate": 19200 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /test/test_01_04/ce1_01.04_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 0, 28 | "timezone": 0, 29 | "adjustment": 0 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": { 46 | "remote_frames": 0, 47 | "id": [ 48 | { 49 | "name": "Ch1AllStandard", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 0, 53 | "method": 1, 54 | "f1": "7FF", 55 | "f2": "0", 56 | "prescaler_type": 0 57 | }, 58 | { 59 | "name": "Ch1AllExtended", 60 | "state": 1, 61 | "type": 0, 62 | "id_format": 1, 63 | "method": 1, 64 | "f1": "1FFFFFFF", 65 | "f2": "0", 66 | "prescaler_type": 0 67 | } 68 | ] 69 | }, 70 | "heartbeat": { 71 | "state": 0, 72 | "id_format": 1, 73 | "id": "00435353" 74 | }, 75 | "control": { 76 | "control_rx_state": 0, 77 | "control_tx_state": 0, 78 | "start": { 79 | "id_format": 1, 80 | "id": "00435354", 81 | "id_mask": "1FFFFFFF", 82 | "data_mask": "FFFFFFFFFFFFFFFF", 83 | "data_high": "0100000000000000", 84 | "data_low": "0100000000000000" 85 | }, 86 | "stop": { 87 | "id_format": 1, 88 | "id": "00435354", 89 | "id_mask": "1FFFFFFF", 90 | "data_mask": "FFFFFFFFFFFFFFFF", 91 | "data_high": "0000000000000000", 92 | "data_low": "0000000000000000" 93 | } 94 | } 95 | }, 96 | "can_2": { 97 | "general": { 98 | "rx_state": 1, 99 | "tx_state": 1 100 | }, 101 | "phy": { 102 | "mode": 1, 103 | "retransmission": 1, 104 | "fd_spec": 0, 105 | "bit_rate_cfg_mode": 0 106 | }, 107 | "filter": { 108 | "remote_frames": 0, 109 | "id": [ 110 | { 111 | "name": "Ch2AllStandard", 112 | "state": 1, 113 | "type": 0, 114 | "id_format": 0, 115 | "method": 1, 116 | "f1": "7FF", 117 | "f2": "0", 118 | "prescaler_type": 0 119 | }, 120 | { 121 | "name": "Ch2AllExtended", 122 | "state": 1, 123 | "type": 0, 124 | "id_format": 1, 125 | "method": 1, 126 | "f1": "1FFFFFFF", 127 | "f2": "0", 128 | "prescaler_type": 0 129 | } 130 | ] 131 | }, 132 | "heartbeat": { 133 | "state": 0, 134 | "id_format": 1, 135 | "id": "00435353" 136 | }, 137 | "control": { 138 | "control_rx_state": 0, 139 | "control_tx_state": 0, 140 | "start": { 141 | "id_format": 1, 142 | "id": "00435354", 143 | "id_mask": "1FFFFFFF", 144 | "data_mask": "FFFFFFFFFFFFFFFF", 145 | "data_high": "0100000000000000", 146 | "data_low": "0100000000000000" 147 | }, 148 | "stop": { 149 | "id_format": 1, 150 | "id": "00435354", 151 | "id_mask": "1FFFFFFF", 152 | "data_mask": "FFFFFFFFFFFFFFFF", 153 | "data_high": "0000000000000000", 154 | "data_low": "0000000000000000" 155 | } 156 | } 157 | }, 158 | "lin_1": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "lin_2": { 165 | "phy": { 166 | "mode": 0, 167 | "bit_rate": 19200 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /test/test_01_04/ce2_01.03_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | } 22 | }, 23 | "rtc": { 24 | "sync": 2, 25 | "timezone": 0, 26 | "adjustment": 0, 27 | "ntp_server": "*.pool.ntp.org", 28 | "ntp_fallback": 0, 29 | "tolerance": 30 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": [ 46 | { 47 | "name": "Ch1AllStandard", 48 | "state": 1, 49 | "type": 0, 50 | "id_format": 0, 51 | "method": 1, 52 | "f1": "7FF", 53 | "f2": "0", 54 | "prescaler_type": 0 55 | }, 56 | { 57 | "name": "Ch1AllExtended", 58 | "state": 1, 59 | "type": 0, 60 | "id_format": 1, 61 | "method": 1, 62 | "f1": "1FFFFFFF", 63 | "f2": "0", 64 | "prescaler_type": 0 65 | } 66 | ], 67 | "heartbeat": { 68 | "state": 0, 69 | "id_format": 1, 70 | "id": "00435353" 71 | }, 72 | "control": { 73 | "control_rx_state": 0, 74 | "control_tx_state": 0, 75 | "start": { 76 | "id_format": 1, 77 | "id": "00435354", 78 | "id_mask": "1FFFFFFF", 79 | "data_mask": "FFFFFFFFFFFFFFFF", 80 | "data_high": "0100000000000000", 81 | "data_low": "0100000000000000" 82 | }, 83 | "stop": { 84 | "id_format": 1, 85 | "id": "00435354", 86 | "id_mask": "1FFFFFFF", 87 | "data_mask": "FFFFFFFFFFFFFFFF", 88 | "data_high": "0000000000000000", 89 | "data_low": "0000000000000000" 90 | } 91 | } 92 | }, 93 | "can_2": { 94 | "general": { 95 | "rx_state": 1, 96 | "tx_state": 1 97 | }, 98 | "phy": { 99 | "mode": 1, 100 | "retransmission": 1, 101 | "fd_spec": 0, 102 | "bit_rate_cfg_mode": 0 103 | }, 104 | "filter": [ 105 | { 106 | "name": "Ch2AllStandard", 107 | "state": 1, 108 | "type": 0, 109 | "id_format": 0, 110 | "method": 1, 111 | "f1": "7FF", 112 | "f2": "0", 113 | "prescaler_type": 0 114 | }, 115 | { 116 | "name": "Ch2AllExtended", 117 | "state": 1, 118 | "type": 0, 119 | "id_format": 1, 120 | "method": 1, 121 | "f1": "1FFFFFFF", 122 | "f2": "0", 123 | "prescaler_type": 0 124 | } 125 | ], 126 | "heartbeat": { 127 | "state": 0, 128 | "id_format": 1, 129 | "id": "00435353" 130 | }, 131 | "control": { 132 | "control_rx_state": 0, 133 | "control_tx_state": 0, 134 | "start": { 135 | "id_format": 1, 136 | "id": "00435354", 137 | "id_mask": "1FFFFFFF", 138 | "data_mask": "FFFFFFFFFFFFFFFF", 139 | "data_high": "0100000000000000", 140 | "data_low": "0100000000000000" 141 | }, 142 | "stop": { 143 | "id_format": 1, 144 | "id": "00435354", 145 | "id_mask": "1FFFFFFF", 146 | "data_mask": "FFFFFFFFFFFFFFFF", 147 | "data_high": "0000000000000000", 148 | "data_low": "0000000000000000" 149 | } 150 | } 151 | }, 152 | "lin_1": { 153 | "phy": { 154 | "mode": 0, 155 | "bit_rate": 19200 156 | } 157 | }, 158 | "lin_2": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "connect": { 165 | "wifi": { 166 | "mode": 0, 167 | "keyformat": 0, 168 | "accesspoint": [] 169 | }, 170 | "s3": { 171 | "sync": { 172 | "ota": 600, 173 | "heartbeat": 300, 174 | "logfiles": 1 175 | }, 176 | "server": { 177 | "keyformat": 0, 178 | "signed_payload": 0 179 | } 180 | } 181 | } 182 | } -------------------------------------------------------------------------------- /test/test_01_04/ce2_01.04_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 2, 28 | "timezone": 0, 29 | "adjustment": 0, 30 | "ntp_server": "*.pool.ntp.org", 31 | "ntp_fallback": 0, 32 | "tolerance": 30 33 | }, 34 | "secondaryport": { 35 | "power_schedule": [] 36 | }, 37 | "can_1": { 38 | "general": { 39 | "rx_state": 1, 40 | "tx_state": 1 41 | }, 42 | "phy": { 43 | "mode": 1, 44 | "retransmission": 1, 45 | "fd_spec": 0, 46 | "bit_rate_cfg_mode": 0 47 | }, 48 | "filter": { 49 | "remote_frames": 0, 50 | "id": [ 51 | { 52 | "name": "Ch1AllStandard", 53 | "state": 1, 54 | "type": 0, 55 | "id_format": 0, 56 | "method": 1, 57 | "f1": "7FF", 58 | "f2": "0", 59 | "prescaler_type": 0 60 | }, 61 | { 62 | "name": "Ch1AllExtended", 63 | "state": 1, 64 | "type": 0, 65 | "id_format": 1, 66 | "method": 1, 67 | "f1": "1FFFFFFF", 68 | "f2": "0", 69 | "prescaler_type": 0 70 | } 71 | ] 72 | }, 73 | "heartbeat": { 74 | "state": 0, 75 | "id_format": 1, 76 | "id": "00435353" 77 | }, 78 | "control": { 79 | "control_rx_state": 0, 80 | "control_tx_state": 0, 81 | "start": { 82 | "id_format": 1, 83 | "id": "00435354", 84 | "id_mask": "1FFFFFFF", 85 | "data_mask": "FFFFFFFFFFFFFFFF", 86 | "data_high": "0100000000000000", 87 | "data_low": "0100000000000000" 88 | }, 89 | "stop": { 90 | "id_format": 1, 91 | "id": "00435354", 92 | "id_mask": "1FFFFFFF", 93 | "data_mask": "FFFFFFFFFFFFFFFF", 94 | "data_high": "0000000000000000", 95 | "data_low": "0000000000000000" 96 | } 97 | } 98 | }, 99 | "can_2": { 100 | "general": { 101 | "rx_state": 1, 102 | "tx_state": 1 103 | }, 104 | "phy": { 105 | "mode": 1, 106 | "retransmission": 1, 107 | "fd_spec": 0, 108 | "bit_rate_cfg_mode": 0 109 | }, 110 | "filter": { 111 | "remote_frames": 0, 112 | "id": [ 113 | { 114 | "name": "Ch2AllStandard", 115 | "state": 1, 116 | "type": 0, 117 | "id_format": 0, 118 | "method": 1, 119 | "f1": "7FF", 120 | "f2": "0", 121 | "prescaler_type": 0 122 | }, 123 | { 124 | "name": "Ch2AllExtended", 125 | "state": 1, 126 | "type": 0, 127 | "id_format": 1, 128 | "method": 1, 129 | "f1": "1FFFFFFF", 130 | "f2": "0", 131 | "prescaler_type": 0 132 | } 133 | ] 134 | }, 135 | "heartbeat": { 136 | "state": 0, 137 | "id_format": 1, 138 | "id": "00435353" 139 | }, 140 | "control": { 141 | "control_rx_state": 0, 142 | "control_tx_state": 0, 143 | "start": { 144 | "id_format": 1, 145 | "id": "00435354", 146 | "id_mask": "1FFFFFFF", 147 | "data_mask": "FFFFFFFFFFFFFFFF", 148 | "data_high": "0100000000000000", 149 | "data_low": "0100000000000000" 150 | }, 151 | "stop": { 152 | "id_format": 1, 153 | "id": "00435354", 154 | "id_mask": "1FFFFFFF", 155 | "data_mask": "FFFFFFFFFFFFFFFF", 156 | "data_high": "0000000000000000", 157 | "data_low": "0000000000000000" 158 | } 159 | } 160 | }, 161 | "lin_1": { 162 | "phy": { 163 | "mode": 0, 164 | "bit_rate": 19200 165 | } 166 | }, 167 | "lin_2": { 168 | "phy": { 169 | "mode": 0, 170 | "bit_rate": 19200 171 | } 172 | }, 173 | "connect": { 174 | "wifi": { 175 | "mode": 0, 176 | "keyformat": 0, 177 | "accesspoint": [] 178 | }, 179 | "s3": { 180 | "sync": { 181 | "ota": 600, 182 | "heartbeat": 300, 183 | "logfiles": 1 184 | }, 185 | "server": { 186 | "request_style": 0, 187 | "keyformat": 0, 188 | "signed_payload": 0 189 | } 190 | } 191 | } 192 | } -------------------------------------------------------------------------------- /test/test_01_04/test_01_04.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | 6 | class Test_01_04(TestMigrate): 7 | 8 | _simulated_devices_nof = 10 9 | 10 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 11 | [ 12 | # CANedge 1 13 | # Default to default 14 | ( 15 | CANedgeType.CANEDGE1, 16 | "fw/ce1-01.03.01.zip", 17 | "fw/ce1-01.04.01.zip", 18 | "test_01_04/ce1_01.03_1.json", 19 | "test_01_04/ce1_01.04_1.json", 20 | "config.config_func_01_03_XX_01_04_XX" 21 | ), 22 | # CANedge 1 23 | # Without lin to mandatory lin 24 | ( 25 | CANedgeType.CANEDGE1, 26 | "fw/ce1-01.03.01.zip", 27 | "fw/ce1-01.04.01.zip", 28 | "test_01_04/ce1_01.03_2.json", 29 | "test_01_04/ce1_01.04_2.json", 30 | "config.config_func_01_03_XX_01_04_XX" 31 | ), 32 | # CANedge 2 33 | # Default to default 34 | ( 35 | CANedgeType.CANEDGE2, 36 | "fw/ce2-01.03.01.zip", 37 | "fw/ce2-01.04.01.zip", 38 | "test_01_04/ce2_01.03_1.json", 39 | "test_01_04/ce2_01.04_1.json", 40 | "config.config_func_01_03_XX_01_04_XX" 41 | ), 42 | ]) 43 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 44 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 45 | -------------------------------------------------------------------------------- /test/test_01_06/ce1_01.04_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 0, 28 | "timezone": 0, 29 | "adjustment": 0 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": { 46 | "remote_frames": 0, 47 | "id": [ 48 | { 49 | "name": "Ch1AllStandard", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 0, 53 | "method": 1, 54 | "f1": "7FF", 55 | "f2": "0", 56 | "prescaler_type": 0 57 | }, 58 | { 59 | "name": "Ch1AllExtended", 60 | "state": 1, 61 | "type": 0, 62 | "id_format": 1, 63 | "method": 1, 64 | "f1": "1FFFFFFF", 65 | "f2": "0", 66 | "prescaler_type": 0 67 | } 68 | ] 69 | }, 70 | "heartbeat": { 71 | "state": 0, 72 | "id_format": 1, 73 | "id": "00435353" 74 | }, 75 | "control": { 76 | "control_rx_state": 0, 77 | "control_tx_state": 0, 78 | "start": { 79 | "id_format": 1, 80 | "id": "00435354", 81 | "id_mask": "1FFFFFFF", 82 | "data_mask": "FFFFFFFFFFFFFFFF", 83 | "data_high": "0100000000000000", 84 | "data_low": "0100000000000000" 85 | }, 86 | "stop": { 87 | "id_format": 1, 88 | "id": "00435354", 89 | "id_mask": "1FFFFFFF", 90 | "data_mask": "FFFFFFFFFFFFFFFF", 91 | "data_high": "0000000000000000", 92 | "data_low": "0000000000000000" 93 | } 94 | } 95 | }, 96 | "can_2": { 97 | "general": { 98 | "rx_state": 1, 99 | "tx_state": 1 100 | }, 101 | "phy": { 102 | "mode": 1, 103 | "retransmission": 1, 104 | "fd_spec": 0, 105 | "bit_rate_cfg_mode": 0 106 | }, 107 | "filter": { 108 | "remote_frames": 0, 109 | "id": [ 110 | { 111 | "name": "Ch2AllStandard", 112 | "state": 1, 113 | "type": 0, 114 | "id_format": 0, 115 | "method": 1, 116 | "f1": "7FF", 117 | "f2": "0", 118 | "prescaler_type": 0 119 | }, 120 | { 121 | "name": "Ch2AllExtended", 122 | "state": 1, 123 | "type": 0, 124 | "id_format": 1, 125 | "method": 1, 126 | "f1": "1FFFFFFF", 127 | "f2": "0", 128 | "prescaler_type": 0 129 | } 130 | ] 131 | }, 132 | "heartbeat": { 133 | "state": 0, 134 | "id_format": 1, 135 | "id": "00435353" 136 | }, 137 | "control": { 138 | "control_rx_state": 0, 139 | "control_tx_state": 0, 140 | "start": { 141 | "id_format": 1, 142 | "id": "00435354", 143 | "id_mask": "1FFFFFFF", 144 | "data_mask": "FFFFFFFFFFFFFFFF", 145 | "data_high": "0100000000000000", 146 | "data_low": "0100000000000000" 147 | }, 148 | "stop": { 149 | "id_format": 1, 150 | "id": "00435354", 151 | "id_mask": "1FFFFFFF", 152 | "data_mask": "FFFFFFFFFFFFFFFF", 153 | "data_high": "0000000000000000", 154 | "data_low": "0000000000000000" 155 | } 156 | } 157 | }, 158 | "lin_1": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "lin_2": { 165 | "phy": { 166 | "mode": 0, 167 | "bit_rate": 19200 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /test/test_01_06/ce1_01.06_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 0, 28 | "timezone": 0, 29 | "adjustment": 0 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": { 46 | "remote_frames": 0, 47 | "id": [ 48 | { 49 | "name": "Ch1AllStandard", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 0, 53 | "method": 1, 54 | "f1": "7FF", 55 | "f2": "0", 56 | "prescaler_type": 0 57 | }, 58 | { 59 | "name": "Ch1AllExtended", 60 | "state": 1, 61 | "type": 0, 62 | "id_format": 1, 63 | "method": 1, 64 | "f1": "1FFFFFFF", 65 | "f2": "0", 66 | "prescaler_type": 0 67 | } 68 | ] 69 | }, 70 | "heartbeat": { 71 | "state": 0, 72 | "id_format": 1, 73 | "id": "00435353" 74 | }, 75 | "control": { 76 | "control_rx_state": 0, 77 | "control_tx_state": 0, 78 | "start": { 79 | "id_format": 1, 80 | "id": "00435354", 81 | "id_mask": "1FFFFFFF", 82 | "data_mask": "FFFFFFFFFFFFFFFF", 83 | "data_high": "0100000000000000", 84 | "data_low": "0100000000000000" 85 | }, 86 | "stop": { 87 | "id_format": 1, 88 | "id": "00435354", 89 | "id_mask": "1FFFFFFF", 90 | "data_mask": "FFFFFFFFFFFFFFFF", 91 | "data_high": "0000000000000000", 92 | "data_low": "0000000000000000" 93 | } 94 | } 95 | }, 96 | "can_2": { 97 | "general": { 98 | "rx_state": 1, 99 | "tx_state": 1 100 | }, 101 | "phy": { 102 | "mode": 1, 103 | "retransmission": 1, 104 | "fd_spec": 0, 105 | "bit_rate_cfg_mode": 0 106 | }, 107 | "filter": { 108 | "remote_frames": 0, 109 | "id": [ 110 | { 111 | "name": "Ch2AllStandard", 112 | "state": 1, 113 | "type": 0, 114 | "id_format": 0, 115 | "method": 1, 116 | "f1": "7FF", 117 | "f2": "0", 118 | "prescaler_type": 0 119 | }, 120 | { 121 | "name": "Ch2AllExtended", 122 | "state": 1, 123 | "type": 0, 124 | "id_format": 1, 125 | "method": 1, 126 | "f1": "1FFFFFFF", 127 | "f2": "0", 128 | "prescaler_type": 0 129 | } 130 | ] 131 | }, 132 | "heartbeat": { 133 | "state": 0, 134 | "id_format": 1, 135 | "id": "00435353" 136 | }, 137 | "control": { 138 | "control_rx_state": 0, 139 | "control_tx_state": 0, 140 | "start": { 141 | "id_format": 1, 142 | "id": "00435354", 143 | "id_mask": "1FFFFFFF", 144 | "data_mask": "FFFFFFFFFFFFFFFF", 145 | "data_high": "0100000000000000", 146 | "data_low": "0100000000000000" 147 | }, 148 | "stop": { 149 | "id_format": 1, 150 | "id": "00435354", 151 | "id_mask": "1FFFFFFF", 152 | "data_mask": "FFFFFFFFFFFFFFFF", 153 | "data_high": "0000000000000000", 154 | "data_low": "0000000000000000" 155 | } 156 | } 157 | }, 158 | "lin_1": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "lin_2": { 165 | "phy": { 166 | "mode": 0, 167 | "bit_rate": 19200 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /test/test_01_06/ce2_01.04_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 2, 28 | "timezone": 0, 29 | "adjustment": 0, 30 | "ntp_server": "*.pool.ntp.org", 31 | "ntp_fallback": 0, 32 | "tolerance": 30 33 | }, 34 | "secondaryport": { 35 | "power_schedule": [] 36 | }, 37 | "can_1": { 38 | "general": { 39 | "rx_state": 1, 40 | "tx_state": 1 41 | }, 42 | "phy": { 43 | "mode": 1, 44 | "retransmission": 1, 45 | "fd_spec": 0, 46 | "bit_rate_cfg_mode": 0 47 | }, 48 | "filter": { 49 | "remote_frames": 0, 50 | "id": [ 51 | { 52 | "name": "Ch1AllStandard", 53 | "state": 1, 54 | "type": 0, 55 | "id_format": 0, 56 | "method": 1, 57 | "f1": "7FF", 58 | "f2": "0", 59 | "prescaler_type": 0 60 | }, 61 | { 62 | "name": "Ch1AllExtended", 63 | "state": 1, 64 | "type": 0, 65 | "id_format": 1, 66 | "method": 1, 67 | "f1": "1FFFFFFF", 68 | "f2": "0", 69 | "prescaler_type": 0 70 | } 71 | ] 72 | }, 73 | "heartbeat": { 74 | "state": 0, 75 | "id_format": 1, 76 | "id": "00435353" 77 | }, 78 | "control": { 79 | "control_rx_state": 0, 80 | "control_tx_state": 0, 81 | "start": { 82 | "id_format": 1, 83 | "id": "00435354", 84 | "id_mask": "1FFFFFFF", 85 | "data_mask": "FFFFFFFFFFFFFFFF", 86 | "data_high": "0100000000000000", 87 | "data_low": "0100000000000000" 88 | }, 89 | "stop": { 90 | "id_format": 1, 91 | "id": "00435354", 92 | "id_mask": "1FFFFFFF", 93 | "data_mask": "FFFFFFFFFFFFFFFF", 94 | "data_high": "0000000000000000", 95 | "data_low": "0000000000000000" 96 | } 97 | } 98 | }, 99 | "can_2": { 100 | "general": { 101 | "rx_state": 1, 102 | "tx_state": 1 103 | }, 104 | "phy": { 105 | "mode": 1, 106 | "retransmission": 1, 107 | "fd_spec": 0, 108 | "bit_rate_cfg_mode": 0 109 | }, 110 | "filter": { 111 | "remote_frames": 0, 112 | "id": [ 113 | { 114 | "name": "Ch2AllStandard", 115 | "state": 1, 116 | "type": 0, 117 | "id_format": 0, 118 | "method": 1, 119 | "f1": "7FF", 120 | "f2": "0", 121 | "prescaler_type": 0 122 | }, 123 | { 124 | "name": "Ch2AllExtended", 125 | "state": 1, 126 | "type": 0, 127 | "id_format": 1, 128 | "method": 1, 129 | "f1": "1FFFFFFF", 130 | "f2": "0", 131 | "prescaler_type": 0 132 | } 133 | ] 134 | }, 135 | "heartbeat": { 136 | "state": 0, 137 | "id_format": 1, 138 | "id": "00435353" 139 | }, 140 | "control": { 141 | "control_rx_state": 0, 142 | "control_tx_state": 0, 143 | "start": { 144 | "id_format": 1, 145 | "id": "00435354", 146 | "id_mask": "1FFFFFFF", 147 | "data_mask": "FFFFFFFFFFFFFFFF", 148 | "data_high": "0100000000000000", 149 | "data_low": "0100000000000000" 150 | }, 151 | "stop": { 152 | "id_format": 1, 153 | "id": "00435354", 154 | "id_mask": "1FFFFFFF", 155 | "data_mask": "FFFFFFFFFFFFFFFF", 156 | "data_high": "0000000000000000", 157 | "data_low": "0000000000000000" 158 | } 159 | } 160 | }, 161 | "lin_1": { 162 | "phy": { 163 | "mode": 0, 164 | "bit_rate": 19200 165 | } 166 | }, 167 | "lin_2": { 168 | "phy": { 169 | "mode": 0, 170 | "bit_rate": 19200 171 | } 172 | }, 173 | "connect": { 174 | "wifi": { 175 | "mode": 0, 176 | "keyformat": 0, 177 | "accesspoint": [] 178 | }, 179 | "s3": { 180 | "sync": { 181 | "ota": 600, 182 | "heartbeat": 300, 183 | "logfiles": 1 184 | }, 185 | "server": { 186 | "request_style": 0, 187 | "keyformat": 0, 188 | "signed_payload": 0 189 | } 190 | } 191 | } 192 | } -------------------------------------------------------------------------------- /test/test_01_06/ce2_01.06_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 2, 28 | "timezone": 0, 29 | "adjustment": 0, 30 | "ntp_server": "*.pool.ntp.org", 31 | "ntp_fallback": 0, 32 | "tolerance": 30 33 | }, 34 | "secondaryport": { 35 | "power_schedule": [] 36 | }, 37 | "can_1": { 38 | "general": { 39 | "rx_state": 1, 40 | "tx_state": 1 41 | }, 42 | "phy": { 43 | "mode": 1, 44 | "retransmission": 1, 45 | "fd_spec": 0, 46 | "bit_rate_cfg_mode": 0 47 | }, 48 | "filter": { 49 | "remote_frames": 0, 50 | "id": [ 51 | { 52 | "name": "Ch1AllStandard", 53 | "state": 1, 54 | "type": 0, 55 | "id_format": 0, 56 | "method": 1, 57 | "f1": "7FF", 58 | "f2": "0", 59 | "prescaler_type": 0 60 | }, 61 | { 62 | "name": "Ch1AllExtended", 63 | "state": 1, 64 | "type": 0, 65 | "id_format": 1, 66 | "method": 1, 67 | "f1": "1FFFFFFF", 68 | "f2": "0", 69 | "prescaler_type": 0 70 | } 71 | ] 72 | }, 73 | "heartbeat": { 74 | "state": 0, 75 | "id_format": 1, 76 | "id": "00435353" 77 | }, 78 | "control": { 79 | "control_rx_state": 0, 80 | "control_tx_state": 0, 81 | "start": { 82 | "id_format": 1, 83 | "id": "00435354", 84 | "id_mask": "1FFFFFFF", 85 | "data_mask": "FFFFFFFFFFFFFFFF", 86 | "data_high": "0100000000000000", 87 | "data_low": "0100000000000000" 88 | }, 89 | "stop": { 90 | "id_format": 1, 91 | "id": "00435354", 92 | "id_mask": "1FFFFFFF", 93 | "data_mask": "FFFFFFFFFFFFFFFF", 94 | "data_high": "0000000000000000", 95 | "data_low": "0000000000000000" 96 | } 97 | } 98 | }, 99 | "can_2": { 100 | "general": { 101 | "rx_state": 1, 102 | "tx_state": 1 103 | }, 104 | "phy": { 105 | "mode": 1, 106 | "retransmission": 1, 107 | "fd_spec": 0, 108 | "bit_rate_cfg_mode": 0 109 | }, 110 | "filter": { 111 | "remote_frames": 0, 112 | "id": [ 113 | { 114 | "name": "Ch2AllStandard", 115 | "state": 1, 116 | "type": 0, 117 | "id_format": 0, 118 | "method": 1, 119 | "f1": "7FF", 120 | "f2": "0", 121 | "prescaler_type": 0 122 | }, 123 | { 124 | "name": "Ch2AllExtended", 125 | "state": 1, 126 | "type": 0, 127 | "id_format": 1, 128 | "method": 1, 129 | "f1": "1FFFFFFF", 130 | "f2": "0", 131 | "prescaler_type": 0 132 | } 133 | ] 134 | }, 135 | "heartbeat": { 136 | "state": 0, 137 | "id_format": 1, 138 | "id": "00435353" 139 | }, 140 | "control": { 141 | "control_rx_state": 0, 142 | "control_tx_state": 0, 143 | "start": { 144 | "id_format": 1, 145 | "id": "00435354", 146 | "id_mask": "1FFFFFFF", 147 | "data_mask": "FFFFFFFFFFFFFFFF", 148 | "data_high": "0100000000000000", 149 | "data_low": "0100000000000000" 150 | }, 151 | "stop": { 152 | "id_format": 1, 153 | "id": "00435354", 154 | "id_mask": "1FFFFFFF", 155 | "data_mask": "FFFFFFFFFFFFFFFF", 156 | "data_high": "0000000000000000", 157 | "data_low": "0000000000000000" 158 | } 159 | } 160 | }, 161 | "lin_1": { 162 | "phy": { 163 | "mode": 0, 164 | "bit_rate": 19200 165 | } 166 | }, 167 | "lin_2": { 168 | "phy": { 169 | "mode": 0, 170 | "bit_rate": 19200 171 | } 172 | }, 173 | "connect": { 174 | "wifi": { 175 | "mode": 0, 176 | "keyformat": 0, 177 | "accesspoint": [] 178 | }, 179 | "s3": { 180 | "sync": { 181 | "ota": 600, 182 | "heartbeat": 300, 183 | "logfiles": 1 184 | }, 185 | "server": { 186 | "request_style": 0, 187 | "keyformat": 0, 188 | "signed_payload": 0 189 | } 190 | } 191 | } 192 | } -------------------------------------------------------------------------------- /test/test_01_06/test_01_06.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | class Test_01_06(TestMigrate): 6 | 7 | _simulated_devices_nof = 10 8 | 9 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 10 | [ 11 | # CANedge 1 12 | # Default to default 13 | ( 14 | CANedgeType.CANEDGE1, 15 | "fw/ce1-01.04.01.zip", 16 | "fw/ce1-01.06.02.zip", 17 | "test_01_06/ce1_01.04_1.json", 18 | "test_01_06/ce1_01.06_1.json", 19 | "config.config_func_01_04_XX_01_06_XX" 20 | ), 21 | # CANedge 2 22 | # Default to default 23 | ( 24 | CANedgeType.CANEDGE2, 25 | "fw/ce2-01.04.01.zip", 26 | "fw/ce2-01.06.02.zip", 27 | "test_01_06/ce2_01.04_1.json", 28 | "test_01_06/ce2_01.06_1.json", 29 | "config.config_func_01_04_XX_01_06_XX" 30 | ), 31 | ]) 32 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 33 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 34 | -------------------------------------------------------------------------------- /test/test_01_07/ce1_01.06_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 0, 28 | "timezone": 0, 29 | "adjustment": 0 30 | }, 31 | "secondaryport": { 32 | "power_schedule": [] 33 | }, 34 | "can_1": { 35 | "general": { 36 | "rx_state": 1, 37 | "tx_state": 1 38 | }, 39 | "phy": { 40 | "mode": 1, 41 | "retransmission": 1, 42 | "fd_spec": 0, 43 | "bit_rate_cfg_mode": 0 44 | }, 45 | "filter": { 46 | "remote_frames": 0, 47 | "id": [ 48 | { 49 | "name": "Ch1AllStandard", 50 | "state": 1, 51 | "type": 0, 52 | "id_format": 0, 53 | "method": 1, 54 | "f1": "7FF", 55 | "f2": "0", 56 | "prescaler_type": 0 57 | }, 58 | { 59 | "name": "Ch1AllExtended", 60 | "state": 1, 61 | "type": 0, 62 | "id_format": 1, 63 | "method": 1, 64 | "f1": "1FFFFFFF", 65 | "f2": "0", 66 | "prescaler_type": 0 67 | } 68 | ] 69 | }, 70 | "heartbeat": { 71 | "state": 0, 72 | "id_format": 1, 73 | "id": "00435353" 74 | }, 75 | "control": { 76 | "control_rx_state": 0, 77 | "control_tx_state": 0, 78 | "start": { 79 | "id_format": 1, 80 | "id": "00435354", 81 | "id_mask": "1FFFFFFF", 82 | "data_mask": "FFFFFFFFFFFFFFFF", 83 | "data_high": "0100000000000000", 84 | "data_low": "0100000000000000" 85 | }, 86 | "stop": { 87 | "id_format": 1, 88 | "id": "00435354", 89 | "id_mask": "1FFFFFFF", 90 | "data_mask": "FFFFFFFFFFFFFFFF", 91 | "data_high": "0000000000000000", 92 | "data_low": "0000000000000000" 93 | } 94 | } 95 | }, 96 | "can_2": { 97 | "general": { 98 | "rx_state": 1, 99 | "tx_state": 1 100 | }, 101 | "phy": { 102 | "mode": 1, 103 | "retransmission": 1, 104 | "fd_spec": 0, 105 | "bit_rate_cfg_mode": 0 106 | }, 107 | "filter": { 108 | "remote_frames": 0, 109 | "id": [ 110 | { 111 | "name": "Ch2AllStandard", 112 | "state": 1, 113 | "type": 0, 114 | "id_format": 0, 115 | "method": 1, 116 | "f1": "7FF", 117 | "f2": "0", 118 | "prescaler_type": 0 119 | }, 120 | { 121 | "name": "Ch2AllExtended", 122 | "state": 1, 123 | "type": 0, 124 | "id_format": 1, 125 | "method": 1, 126 | "f1": "1FFFFFFF", 127 | "f2": "0", 128 | "prescaler_type": 0 129 | } 130 | ] 131 | }, 132 | "heartbeat": { 133 | "state": 0, 134 | "id_format": 1, 135 | "id": "00435353" 136 | }, 137 | "control": { 138 | "control_rx_state": 0, 139 | "control_tx_state": 0, 140 | "start": { 141 | "id_format": 1, 142 | "id": "00435354", 143 | "id_mask": "1FFFFFFF", 144 | "data_mask": "FFFFFFFFFFFFFFFF", 145 | "data_high": "0100000000000000", 146 | "data_low": "0100000000000000" 147 | }, 148 | "stop": { 149 | "id_format": 1, 150 | "id": "00435354", 151 | "id_mask": "1FFFFFFF", 152 | "data_mask": "FFFFFFFFFFFFFFFF", 153 | "data_high": "0000000000000000", 154 | "data_low": "0000000000000000" 155 | } 156 | } 157 | }, 158 | "lin_1": { 159 | "phy": { 160 | "mode": 0, 161 | "bit_rate": 19200 162 | } 163 | }, 164 | "lin_2": { 165 | "phy": { 166 | "mode": 0, 167 | "bit_rate": 19200 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /test/test_01_07/ce2_01.06_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 2, 28 | "timezone": 0, 29 | "adjustment": 0, 30 | "ntp_server": "*.pool.ntp.org", 31 | "ntp_fallback": 0, 32 | "tolerance": 30 33 | }, 34 | "secondaryport": { 35 | "power_schedule": [] 36 | }, 37 | "can_1": { 38 | "general": { 39 | "rx_state": 1, 40 | "tx_state": 1 41 | }, 42 | "phy": { 43 | "mode": 1, 44 | "retransmission": 1, 45 | "fd_spec": 0, 46 | "bit_rate_cfg_mode": 0 47 | }, 48 | "filter": { 49 | "remote_frames": 0, 50 | "id": [ 51 | { 52 | "name": "Ch1AllStandard", 53 | "state": 1, 54 | "type": 0, 55 | "id_format": 0, 56 | "method": 1, 57 | "f1": "7FF", 58 | "f2": "0", 59 | "prescaler_type": 0 60 | }, 61 | { 62 | "name": "Ch1AllExtended", 63 | "state": 1, 64 | "type": 0, 65 | "id_format": 1, 66 | "method": 1, 67 | "f1": "1FFFFFFF", 68 | "f2": "0", 69 | "prescaler_type": 0 70 | } 71 | ] 72 | }, 73 | "heartbeat": { 74 | "state": 0, 75 | "id_format": 1, 76 | "id": "00435353" 77 | }, 78 | "control": { 79 | "control_rx_state": 0, 80 | "control_tx_state": 0, 81 | "start": { 82 | "id_format": 1, 83 | "id": "00435354", 84 | "id_mask": "1FFFFFFF", 85 | "data_mask": "FFFFFFFFFFFFFFFF", 86 | "data_high": "0100000000000000", 87 | "data_low": "0100000000000000" 88 | }, 89 | "stop": { 90 | "id_format": 1, 91 | "id": "00435354", 92 | "id_mask": "1FFFFFFF", 93 | "data_mask": "FFFFFFFFFFFFFFFF", 94 | "data_high": "0000000000000000", 95 | "data_low": "0000000000000000" 96 | } 97 | } 98 | }, 99 | "can_2": { 100 | "general": { 101 | "rx_state": 1, 102 | "tx_state": 1 103 | }, 104 | "phy": { 105 | "mode": 1, 106 | "retransmission": 1, 107 | "fd_spec": 0, 108 | "bit_rate_cfg_mode": 0 109 | }, 110 | "filter": { 111 | "remote_frames": 0, 112 | "id": [ 113 | { 114 | "name": "Ch2AllStandard", 115 | "state": 1, 116 | "type": 0, 117 | "id_format": 0, 118 | "method": 1, 119 | "f1": "7FF", 120 | "f2": "0", 121 | "prescaler_type": 0 122 | }, 123 | { 124 | "name": "Ch2AllExtended", 125 | "state": 1, 126 | "type": 0, 127 | "id_format": 1, 128 | "method": 1, 129 | "f1": "1FFFFFFF", 130 | "f2": "0", 131 | "prescaler_type": 0 132 | } 133 | ] 134 | }, 135 | "heartbeat": { 136 | "state": 0, 137 | "id_format": 1, 138 | "id": "00435353" 139 | }, 140 | "control": { 141 | "control_rx_state": 0, 142 | "control_tx_state": 0, 143 | "start": { 144 | "id_format": 1, 145 | "id": "00435354", 146 | "id_mask": "1FFFFFFF", 147 | "data_mask": "FFFFFFFFFFFFFFFF", 148 | "data_high": "0100000000000000", 149 | "data_low": "0100000000000000" 150 | }, 151 | "stop": { 152 | "id_format": 1, 153 | "id": "00435354", 154 | "id_mask": "1FFFFFFF", 155 | "data_mask": "FFFFFFFFFFFFFFFF", 156 | "data_high": "0000000000000000", 157 | "data_low": "0000000000000000" 158 | } 159 | } 160 | }, 161 | "lin_1": { 162 | "phy": { 163 | "mode": 0, 164 | "bit_rate": 19200 165 | } 166 | }, 167 | "lin_2": { 168 | "phy": { 169 | "mode": 0, 170 | "bit_rate": 19200 171 | } 172 | }, 173 | "connect": { 174 | "wifi": { 175 | "mode": 0, 176 | "keyformat": 0, 177 | "accesspoint": [] 178 | }, 179 | "s3": { 180 | "sync": { 181 | "ota": 600, 182 | "heartbeat": 300, 183 | "logfiles": 1 184 | }, 185 | "server": { 186 | "request_style": 0, 187 | "keyformat": 0, 188 | "signed_payload": 0 189 | } 190 | } 191 | } 192 | } -------------------------------------------------------------------------------- /test/test_01_07/ce2_01.06_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "device": {}, 4 | "security": {}, 5 | "debug": { 6 | "syslog": 0 7 | } 8 | }, 9 | "log": { 10 | "file": { 11 | "split_size": 50, 12 | "split_time_period": 0, 13 | "split_time_offset": 0, 14 | "cyclic": 1 15 | }, 16 | "compression": { 17 | "level": 0 18 | }, 19 | "encryption": { 20 | "state": 0 21 | }, 22 | "error_frames": { 23 | "state": 0 24 | } 25 | }, 26 | "rtc": { 27 | "sync": 2, 28 | "timezone": 0, 29 | "adjustment": 0, 30 | "ntp_server": "*.pool.ntp.org", 31 | "ntp_fallback": 0, 32 | "tolerance": 30 33 | }, 34 | "secondaryport": { 35 | "power_schedule": [] 36 | }, 37 | "can_1": { 38 | "general": { 39 | "rx_state": 1, 40 | "tx_state": 1 41 | }, 42 | "phy": { 43 | "mode": 1, 44 | "retransmission": 1, 45 | "fd_spec": 0, 46 | "bit_rate_cfg_mode": 0 47 | }, 48 | "filter": { 49 | "remote_frames": 0, 50 | "id": [ 51 | { 52 | "name": "CustomFilter1", 53 | "state": 1, 54 | "type": 0, 55 | "id_format": 0, 56 | "method": 1, 57 | "f1": "7FF", 58 | "f2": "A", 59 | "prescaler_type": 0 60 | }, 61 | { 62 | "name": "CustomFilter2", 63 | "state": 1, 64 | "type": 0, 65 | "id_format": 1, 66 | "method": 1, 67 | "f1": "1FFFFFFF", 68 | "f2": "B", 69 | "prescaler_type": 0 70 | } 71 | ] 72 | }, 73 | "heartbeat": { 74 | "state": 0, 75 | "id_format": 1, 76 | "id": "00435353" 77 | }, 78 | "control": { 79 | "control_rx_state": 0, 80 | "control_tx_state": 0, 81 | "start": { 82 | "id_format": 1, 83 | "id": "00435354", 84 | "id_mask": "1FFFFFFF", 85 | "data_mask": "FFFFFFFFFFFFFFFF", 86 | "data_high": "0100000000000000", 87 | "data_low": "0100000000000000" 88 | }, 89 | "stop": { 90 | "id_format": 1, 91 | "id": "00435354", 92 | "id_mask": "1FFFFFFF", 93 | "data_mask": "FFFFFFFFFFFFFFFF", 94 | "data_high": "0000000000000000", 95 | "data_low": "0000000000000000" 96 | } 97 | } 98 | }, 99 | "can_2": { 100 | "general": { 101 | "rx_state": 1, 102 | "tx_state": 1 103 | }, 104 | "phy": { 105 | "mode": 1, 106 | "retransmission": 1, 107 | "fd_spec": 0, 108 | "bit_rate_cfg_mode": 0 109 | }, 110 | "filter": { 111 | "remote_frames": 0, 112 | "id": [ 113 | { 114 | "name": "CustomFilter1", 115 | "state": 1, 116 | "type": 0, 117 | "id_format": 0, 118 | "method": 1, 119 | "f1": "7FF", 120 | "f2": "A", 121 | "prescaler_type": 0 122 | }, 123 | { 124 | "name": "CustomFilter2", 125 | "state": 1, 126 | "type": 0, 127 | "id_format": 1, 128 | "method": 1, 129 | "f1": "1FFFFFFF", 130 | "f2": "B", 131 | "prescaler_type": 0 132 | } 133 | ] 134 | }, 135 | "heartbeat": { 136 | "state": 0, 137 | "id_format": 1, 138 | "id": "00435353" 139 | }, 140 | "control": { 141 | "control_rx_state": 0, 142 | "control_tx_state": 0, 143 | "start": { 144 | "id_format": 1, 145 | "id": "00435354", 146 | "id_mask": "1FFFFFFF", 147 | "data_mask": "FFFFFFFFFFFFFFFF", 148 | "data_high": "0100000000000000", 149 | "data_low": "0100000000000000" 150 | }, 151 | "stop": { 152 | "id_format": 1, 153 | "id": "00435354", 154 | "id_mask": "1FFFFFFF", 155 | "data_mask": "FFFFFFFFFFFFFFFF", 156 | "data_high": "0000000000000000", 157 | "data_low": "0000000000000000" 158 | } 159 | } 160 | }, 161 | "lin_1": { 162 | "phy": { 163 | "mode": 0, 164 | "bit_rate": 19200 165 | } 166 | }, 167 | "lin_2": { 168 | "phy": { 169 | "mode": 0, 170 | "bit_rate": 19200 171 | } 172 | }, 173 | "connect": { 174 | "wifi": { 175 | "mode": 0, 176 | "keyformat": 0, 177 | "accesspoint": [] 178 | }, 179 | "s3": { 180 | "sync": { 181 | "ota": 600, 182 | "heartbeat": 300, 183 | "logfiles": 1 184 | }, 185 | "server": { 186 | "request_style": 0, 187 | "keyformat": 0, 188 | "signed_payload": 0 189 | } 190 | } 191 | } 192 | } -------------------------------------------------------------------------------- /test/test_01_07/test_01_07.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | 6 | class Test_01_07(TestMigrate): 7 | 8 | _simulated_devices_nof = 10 9 | 10 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 11 | [ 12 | # CANedge 1 13 | # Default to default (NOTE, CAN internal extended id filter changed from "id_format": 0 to "id_format": 1) 14 | ( 15 | CANedgeType.CANEDGE1, 16 | "fw/ce1-01.06.02.zip", 17 | "fw/ce1-01.07.01.zip", 18 | "test_01_07/ce1_01.06_1.json", 19 | "test_01_07/ce1_01.07_1.json", 20 | "config.config_func_01_06_XX_01_07_XX" 21 | ), 22 | # CANedge 2 23 | # Default to default (NOTE, CAN internal extended id filter changed from "id_format": 0 to "id_format": 1) 24 | ( 25 | CANedgeType.CANEDGE2, 26 | "fw/ce2-01.06.02.zip", 27 | "fw/ce2-01.07.01.zip", 28 | "test_01_07/ce2_01.06_1.json", 29 | "test_01_07/ce2_01.07_1.json", 30 | "config.config_func_01_06_XX_01_07_XX" 31 | ), 32 | # CANedge 2 33 | # Five wifi APs reduced to four 34 | ( 35 | CANedgeType.CANEDGE2, 36 | "fw/ce2-01.06.02.zip", 37 | "fw/ce2-01.07.01.zip", 38 | "test_01_07/ce2_01.06_2.json", 39 | "test_01_07/ce2_01.07_2.json", 40 | "config.config_func_01_06_XX_01_07_XX" 41 | ), 42 | # CANedge 2 43 | # With non-default CAN filters. Should migrate filters (not apply the new default) 44 | ( 45 | CANedgeType.CANEDGE2, 46 | "fw/ce2-01.06.02.zip", 47 | "fw/ce2-01.07.01.zip", 48 | "test_01_07/ce2_01.06_3.json", 49 | "test_01_07/ce2_01.07_3.json", 50 | "config.config_func_01_06_XX_01_07_XX" 51 | ), 52 | ]) 53 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 54 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 55 | -------------------------------------------------------------------------------- /test/test_01_08/test_01_08.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from canedge_manager import CANedgeType 3 | from test.test_migrate import TestMigrate 4 | 5 | 6 | class Test_01_08(TestMigrate): 7 | 8 | _simulated_devices_nof = 10 9 | 10 | @pytest.mark.parametrize("type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name", 11 | [ 12 | # CANedge 1 13 | # Default to default 14 | (CANedgeType.CANEDGE1, 15 | "fw/ce1-01.07.01.zip", 16 | "fw/ce1-01.08.01.zip", 17 | "test_01_08/ce1-01.07-default.json", 18 | "test_01_08/ce1-01.08-default.json", 19 | "config.config_func_01_07_XX_01_08_XX" 20 | ), 21 | # CANedge 1 GNSS 22 | # Default to default 23 | (CANedgeType.CANEDGE1G, 24 | "fw/ce1g-01.07.01.zip", 25 | "fw/ce1g-01.08.01.zip", 26 | "test_01_08/ce1g-01.07-default.json", 27 | "test_01_08/ce1g-01.08-default.json", 28 | "config.config_func_01_07_XX_01_08_XX" 29 | ), 30 | # CANedge 2 31 | # Default to default 32 | (CANedgeType.CANEDGE2, 33 | "fw/ce2-01.07.01.zip", 34 | "fw/ce2-01.08.01.zip", 35 | "test_01_08/ce2-01.07-default.json", 36 | "test_01_08/ce2-01.08-default.json", 37 | "config.config_func_01_07_XX_01_08_XX" 38 | ), 39 | # CANedge 2 GNSS 40 | # Default to default 41 | (CANedgeType.CANEDGE2G, 42 | "fw/ce2g-01.07.01.zip", 43 | "fw/ce2g-01.08.01.zip", 44 | "test_01_08/ce2g-01.07-default.json", 45 | "test_01_08/ce2g-01.08-default.json", 46 | "config.config_func_01_07_XX_01_08_XX" 47 | ), 48 | # CANedge 3 GNSS 49 | # Default to default 50 | (CANedgeType.CANEDGE3G, 51 | "fw/ce3g-01.07.07.zip", 52 | "fw/ce3g-01.08.01.zip", 53 | "test_01_08/ce3g-01.07-default.json", 54 | "test_01_08/ce3g-01.08-default.json", 55 | "config.config_func_01_07_XX_01_08_XX" 56 | ), 57 | # CANedge 1 58 | # Remove temporary secondaryport->power_cycle 59 | (CANedgeType.CANEDGE1, 60 | "fw/ce1-01.07.01.zip", 61 | "fw/ce1-01.08.01.zip", 62 | "test_01_08/ce1-01.07-secondaryport-powercycle.json", 63 | "test_01_08/ce1-01.08-secondaryport-powercycle.json", 64 | "config.config_func_01_07_XX_01_08_XX" 65 | ), 66 | ]) 67 | def test_cfg(self, s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 68 | self.main(s3_client, type, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir) 69 | -------------------------------------------------------------------------------- /test/test_migrate.py: -------------------------------------------------------------------------------- 1 | import json 2 | import importlib 3 | from os import path 4 | from canedge_manager import CANedge, CANedgeReturnCodes, CANedgeType 5 | from test.firmware import fw_unpack 6 | from test.s3_simulator import S3Simulate 7 | 8 | 9 | class TestMigrate(object): 10 | 11 | def main(self, s3_client, type: CANedgeType, fw_pack_pre, fw_pack_post, cfg_pre, cfg_post, cfg_func_name, bucket_name, tmpdir): 12 | 13 | # Import config (migration) function 14 | cfg_func_module = importlib.import_module(cfg_func_name) 15 | cfg_func = cfg_func_module.config_func 16 | 17 | # Load expected config after update 18 | with open(cfg_post) as json_file: 19 | config_expected = json.load(json_file) 20 | 21 | # Extract fw packs 22 | fw_pre = fw_unpack(fw_pack_pre, path.join(tmpdir, 'pre')) 23 | fw_post = fw_unpack(fw_pack_post, path.join(tmpdir, 'post')) 24 | 25 | # Create s3 simulation 26 | s3_simulate = S3Simulate(s3_client=s3_client, bucket_name=bucket_name) 27 | s3_simulate.populate(type=type, 28 | schema_name=fw_pre['schema_name'], 29 | config_name=fw_pre['config_name'], 30 | config_path=cfg_pre, 31 | devices_nof=self._simulated_devices_nof) 32 | 33 | # Create canedge manager 34 | ce = CANedge(s3_client, bucket_name, fw_pre['firmware_path'], fw_post['firmware_path']) 35 | 36 | assert len(ce.device_ids) == self._simulated_devices_nof, "Unexpected number of devices found" 37 | 38 | # Update configurations 39 | for result in ce.cfg_update(device_ids_to_update=ce.device_ids, cfg_cb=cfg_func): 40 | assert result['res'] is CANedgeReturnCodes.OK, result['msg'] 41 | 42 | # Get and verify all updated configs 43 | for device_id in ce.device_ids: 44 | config_path_tmp = path.join(tmpdir, 'config.json') 45 | s3_client.fget_object(bucket_name, device_id + '/' + fw_post['config_name'], config_path_tmp) 46 | 47 | # Compare with expected 48 | with open(config_path_tmp) as json_file: 49 | assert json.load(json_file) == config_expected, "Unexpected migration" 50 | 51 | --------------------------------------------------------------------------------