Implement remaining TestClient service commands (#94)
Some checks failed
Native code generation / deterministic (push) Successful in 18m19s
Imaging and meshing gate / native (push) Failing after 4m28s
Native Rust workspace compile / compile (push) Failing after 12m58s

This commit is contained in:
2026-08-11 13:10:27 +00:00
parent 374d7958f1
commit 21f85a1b58
13 changed files with 3300 additions and 24 deletions

View File

@@ -28,6 +28,11 @@ fn mutex<T>(value: &Mutex<T>) -> std::sync::MutexGuard<'_, T> {
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
}
fn read<T>(value: &RwLock<T>) -> std::sync::RwLockReadGuard<'_, T> {
value
.read()
.unwrap_or_else(std::sync::PoisonError::into_inner)
}
fn write<T>(value: &RwLock<T>) -> std::sync::RwLockWriteGuard<'_, T> {
value
.write()
@@ -260,6 +265,15 @@ impl GroupManager {
pub fn current_group_count(&self) -> i32 {
self.inner.group_count.load(Ordering::Acquire)
}
/// Returns a stable snapshot of the groups currently reported for this agent.
///
/// The cache is replaced atomically whenever an `AgentGroupDataUpdate` arrives,
/// so callers never observe a partially decoded group list.
#[must_use]
pub fn current_groups(&self) -> HashMap<UUID, Group> {
read(&self.inner.groups).clone()
}
pub fn group_membership_limit(&self) -> i32 {
let mut client = (*self.inner.client).clone();
client.self_().benefits().group_membership_limit()