#!/usr/bin/expect -f # # Copyright (c) 2024, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the copyright holder nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # source "tests/scripts/expect/_common.exp" set dataset_valid "0x0e,0x08,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x0d,0x35,0x06,0x00,0x04,0x00,0x1f,0xff,0xe0,0x02,0x08,0x1f,0xeb,0xac,0x0f,0xca,0x10,0x8c,0xcd,0x07,0x08,0xfd,0x26,0x9e,0x9f,0x6b,0x8a,0x2a,0xa1,0x05,0x10,0xd3,0x7e,0x6d,0x55,0x73,0xcc,0x88,0x43,0xdb,0x22,0x3b,0x00,0xcd,0x8f,0xf2,0xb0,0x03,0x0f,0x4f,0x70,0x65,0x6e,0x54,0x68,0x72,0x65,0x61,0x64,0x2d,0x65,0x36,0x62,0x37,0x04,0x10,0x16,0xcc,0x1e,0x42,0x3a,0x9c,0xe9,0x47,0xf6,0x05,0x9a,0xe5,0xb8,0x38,0x17,0xb7,0x0c,0x04,0x02,0xa0,0xf7,0xf8,0x01,0x02,0x99,0x99" set dataset_has_pending_timestamp "$dataset_valid,0x33,0x08,0x00,0x00,0x07,0x5b,0xcd,0x15,0x00,0x00" set dataset_has_delay "$dataset_valid,0x34,0x04,0x00,0x00,0x75,0x30" spawn_node 1 otbr $::env(EXP_OT_NCP_PATH) sleep 1 spawn dbus-send --system --dest=io.openthread.BorderRouter.wpan0 --type=method_call --print-reply /io/openthread/BorderRouter/wpan0 io.openthread.BorderRouter.ScheduleMigration "array:byte:${dataset_valid}" "uint32:0x7530" expect Error.InvalidState expect eof spawn dbus-send --system --dest=io.openthread.BorderRouter.wpan0 --type=method_call --print-reply /io/openthread/BorderRouter/wpan0 io.openthread.BorderRouter.ScheduleMigration "array:byte:${dataset_has_pending_timestamp}" "uint32:0x7530" expect Error.InvalidArgs expect eof spawn dbus-send --system --dest=io.openthread.BorderRouter.wpan0 --type=method_call --print-reply /io/openthread/BorderRouter/wpan0 io.openthread.BorderRouter.ScheduleMigration "array:byte:${dataset_has_delay}" "uint32:0x7530" expect Error.InvalidArgs expect eof