Skip to content

Commit

Permalink
[CI] Remove unused DelayCommands functions (#18534)
Browse files Browse the repository at this point in the history
  • Loading branch information
carol-apple authored and pull[bot] committed Aug 23, 2023
1 parent 4eb2f1a commit 0e55735
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 200 deletions.
22 changes: 1 addition & 21 deletions scripts/tests/chiptest/accessories.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ def factoryReset(self, name):
return accessory.factoryReset()
return False

def waitForCommissionableAdvertisement(self, name):
accessory = self.__accessories[name]
if accessory:
return accessory.waitForCommissionableAdvertisement()
return False

def waitForOperationalAdvertisement(self, name):
accessory = self.__accessories[name]
if accessory:
return accessory.waitForOperationalAdvertisement()
return False

def waitForMessage(self, name, message):
accessory = self.__accessories[name]
if accessory:
Expand All @@ -119,15 +107,7 @@ def __startXMLRPCServer(self):
self.server.register_function(self.stop, 'stop')
self.server.register_function(self.reboot, 'reboot')
self.server.register_function(self.factoryReset, 'factoryReset')
self.server.register_function(
self.waitForCommissionableAdvertisement,
'waitForCommissionableAdvertisement')
self.server.register_function(
self.waitForOperationalAdvertisement,
'waitForOperationalAdvertisement')
self.server.register_function(
self.waitForMessage,
'waitForMessage')
self.server.register_function(self.waitForMessage, 'waitForMessage')

self.server_thread = threading.Thread(target=self.server.serve_forever)
self.server_thread.start()
Expand Down
10 changes: 0 additions & 10 deletions scripts/tests/chiptest/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@ def factoryReset(self):
def waitForAnyAdvertisement(self):
self.__waitFor("mDNS service published:", self.process, self.outpipe)

def waitForCommissionableAdvertisement(self):
self.__waitFor("mDNS service published: _matterc._udp",
self.process, self.outpipe)
return True

def waitForOperationalAdvertisement(self):
self.__waitFor("mDNS service published: _matter._tcp",
self.process, self.outpipe)
return True

def waitForMessage(self, message):
self.__waitFor(message, self.process, self.outpipe)
return True
Expand Down
22 changes: 0 additions & 22 deletions src/app/tests/suites/commands/delay/DelayCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,6 @@ void DelayCommands::OnWaitForMsFn(chip::System::Layer * systemLayer, void * cont
command->OnWaitForMs();
}

CHIP_ERROR DelayCommands::WaitForCommissionableAdvertisement(
const char * identity, const chip::app::Clusters::DelayCommands::Commands::WaitForCommissionableAdvertisement::Type & value)
{
const char * scriptDir = getScriptsFolder();
constexpr const char * scriptName = "WaitForCommissionableAdvertisement.py";

char command[128];
VerifyOrReturnError(snprintf(command, sizeof(command), "%s%s", scriptDir, scriptName) >= 0, CHIP_ERROR_INTERNAL);
return RunInternal(command);
}

CHIP_ERROR DelayCommands::WaitForOperationalAdvertisement(
const char * identity, const chip::app::Clusters::DelayCommands::Commands::WaitForOperationalAdvertisement::Type & value)
{
const char * scriptDir = getScriptsFolder();
constexpr const char * scriptName = "WaitForOperationalAdvertisement.py";

char command[128];
VerifyOrReturnError(snprintf(command, sizeof(command), "%s%s", scriptDir, scriptName) >= 0, CHIP_ERROR_INTERNAL);
return RunInternal(command);
}

CHIP_ERROR DelayCommands::WaitForMessage(const char * identity,
const chip::app::Clusters::DelayCommands::Commands::WaitForMessage::Type & value)
{
Expand Down
5 changes: 0 additions & 5 deletions src/app/tests/suites/commands/delay/DelayCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ class DelayCommands
return CHIP_ERROR_NOT_IMPLEMENTED;
};
CHIP_ERROR WaitForMs(const char * identity, const chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type & value);
CHIP_ERROR WaitForCommissionableAdvertisement(
const char * identity,
const chip::app::Clusters::DelayCommands::Commands::WaitForCommissionableAdvertisement::Type & value);
CHIP_ERROR WaitForOperationalAdvertisement(
const char * identity, const chip::app::Clusters::DelayCommands::Commands::WaitForOperationalAdvertisement::Type & value);
// Wait for any message specified by value.message for the application specified by value.registerKey
// If the message is never seen, a timeout would occur
CHIP_ERROR WaitForMessage(const char * identity,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,13 @@ const WaitForCommissionee = {
arguments : [ { type : 'NODE_ID', name : 'nodeId' } ],
};

const WaitForCommissionableAdvertisement = {
name : 'WaitForCommissionableAdvertisement',
};

const WaitForOperationalAdvertisement = {
name : 'WaitForOperationalAdvertisement',
};

const WaitForMessage = {
name : 'WaitForMessage',
arguments : [ { type : 'CHAR_STRING', name : 'registerKey', isOptional : true }, { type : 'CHAR_STRING', name : 'message' } ],
};

const name = 'DelayCommands';
const commands = [
WaitForMs, WaitForCommissioning, WaitForCommissionee, WaitForCommissionableAdvertisement, WaitForOperationalAdvertisement,
WaitForMessage
];
const commands = [ WaitForMs, WaitForCommissioning, WaitForCommissionee, WaitForMessage ];

const DelayCommands = {
name,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e55735

Please sign in to comment.