Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rs/tests/driver/src/driver/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ fn node_to_config(node: &Node) -> NodeConfiguration {
node_operator_principal_id: node.node_operator_principal_id,
secret_key_store: node.secret_key_store.clone(),
domain: node.domain.clone(),
node_reward_type: None,
node_reward_type: node.node_reward_type.clone(),
}
}

Expand Down
7 changes: 7 additions & 0 deletions rs/tests/driver/src/driver/ic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use anyhow::Result;
use ic_prep_lib::prep_state_directory::IcPrepStateDir;
use ic_prep_lib::{node::NodeSecretKeyStore, subnet_configuration::SubnetRunningState};
use ic_protobuf::registry::dc::v1::DataCenterRecord;
use ic_protobuf::registry::node::v1::NodeRewardType;
use ic_regedit;
use ic_registry_canister_api::IPv4Config;
use ic_registry_subnet_features::{ChainKeyConfig, SubnetFeatures};
Expand Down Expand Up @@ -897,6 +898,7 @@ pub struct Node {
pub recovery_hash: Option<String>,
pub boot_image: BootImage,
pub node_operator_principal_id: Option<PrincipalId>,
pub node_reward_type: Option<NodeRewardType>,
}

impl Node {
Expand Down Expand Up @@ -958,4 +960,9 @@ impl Node {
self.recovery_hash = Some(recovery_hash);
self
}

pub fn with_node_reward_type(mut self, reward_type: NodeRewardType) -> Self {
self.node_reward_type = Some(reward_type);
self
}
}
17 changes: 12 additions & 5 deletions rs/tests/testnets/cloud_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use anyhow::Result;

use ic_consensus_system_test_utils::rw_message::install_nns_with_customizations_and_check_progress;
use ic_protobuf::registry::dc::v1::{DataCenterRecord, Gps};
use ic_protobuf::registry::node::v1::NodeRewardType;
use ic_registry_subnet_type::SubnetType;
use ic_system_test_driver::driver::{
group::SystemTestGroup,
Expand Down Expand Up @@ -127,16 +128,22 @@ pub fn setup(env: TestEnv) {
node_provider_principal_id: Some(provider_principal),
node_allowance: 2,
dc_id: dc.id.to_string(),
rewardable_nodes: BTreeMap::from([("type4.1".to_string(), 2)]),
rewardable_nodes: BTreeMap::from([(NodeRewardType::Type4dot1.to_string(), 2)]),
});

// 1 CloudEngine node per DC
cloud_engine_subnet = cloud_engine_subnet
.add_node(Node::new().with_node_operator_principal_id(operator_principal));
cloud_engine_subnet = cloud_engine_subnet.add_node(
Node::new()
.with_node_operator_principal_id(operator_principal)
.with_node_reward_type(NodeRewardType::Type4dot1),
);

// 1 unassigned node per DC
ic = ic
.with_unassigned_node(Node::new().with_node_operator_principal_id(operator_principal));
ic = ic.with_unassigned_node(
Node::new()
.with_node_operator_principal_id(operator_principal)
.with_node_reward_type(NodeRewardType::Type4dot1),
);
}

ic = ic
Expand Down
Loading