Skip to content

Commit

Permalink
[CI] In TC-DM-3.1 maxNetworks and networks attributes read is disabled (
Browse files Browse the repository at this point in the history
#14428)

* [TC-DM-3.1] Network Commissioning Attributes - Query MaxNetworks is disabled

* Update generated test content
  • Loading branch information
vivien-apple authored and pull[bot] committed Nov 7, 2023
1 parent 5fc1a78 commit 1063075
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,53 @@

#include <cstring>

#include <app-common/zap-generated/att-storage.h>
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/callback.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/command-id.h>
#include <app-common/zap-generated/enums.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/util/af.h>
#include <app/util/attribute-storage.h>

using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters::NetworkCommissioning;

namespace {
class NetworkCommissioningAttributeAccess : public AttributeAccessInterface
{
public:
NetworkCommissioningAttributeAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), Id) {}

CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override
{
switch (aPath.mAttributeId)
{
case Attributes::MaxNetworks::Id:
return aEncoder.Encode(static_cast<uint8_t>(0));
case Attributes::Networks::Id:
return aEncoder.EncodeEmptyList();
case Attributes::ScanMaxTimeSeconds::Id:
return aEncoder.Encode(static_cast<uint8_t>(0));
case Attributes::ConnectMaxTimeSeconds::Id:
return aEncoder.Encode(static_cast<uint8_t>(0));
case Attributes::InterfaceEnabled::Id:
return aEncoder.Encode(static_cast<bool>(false));
case Attributes::LastNetworkingStatus::Id:
return aEncoder.Encode(NetworkCommissioningStatus::kSuccess);
case Attributes::LastNetworkID::Id:
return aEncoder.Encode(ByteSpan());
case Attributes::LastConnectErrorValue::Id:
return aEncoder.Encode(Attributes::LastConnectErrorValue::TypeInfo::Type(static_cast<int32_t>(0)));
case Attributes::FeatureMap::Id:
return aEncoder.Encode(static_cast<uint32_t>(0));
default:
return CHIP_NO_ERROR;
}
}
};
} // namespace

bool emberAfNetworkCommissioningClusterAddOrUpdateThreadNetworkCallback(
app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath,
const Commands::AddOrUpdateThreadNetwork::DecodableType & commandData)
Expand Down Expand Up @@ -96,4 +128,8 @@ bool emberAfNetworkCommissioningClusterReorderNetworkCallback(app::CommandHandle
return false;
}

void MatterNetworkCommissioningPluginServerInitCallback() {}
NetworkCommissioningAttributeAccess gAttrAccess;
void MatterNetworkCommissioningPluginServerInitCallback()
{
registerAttributeAccessOverride(&gAttrAccess);
}
2 changes: 0 additions & 2 deletions src/app/tests/suites/certification/Test_TC_DM_3_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ tests:
- label: "Query MaxNetworks"
command: "readAttribute"
attribute: "MaxNetworks"
disabled: true
optional: true
response:
constraints:
Expand All @@ -35,7 +34,6 @@ tests:
- label: "Query Networks"
command: "readAttribute"
attribute: "Networks"
disabled: true
optional: true
response:
constraints:
Expand Down
48 changes: 48 additions & 0 deletions src/darwin/Framework/CHIPTests/CHIPClustersTests.m

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

81 changes: 80 additions & 1 deletion zzz_generated/chip-tool/zap-generated/test/Commands.h

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

0 comments on commit 1063075

Please sign in to comment.