test(apiserver): add integration tests for P0+P1 backend features
Covers ~30 integration tests across 8 sections from the apiserver-backend-integration-test-plan: - §1: Cluster config push (store population, merge semantics, zero-preserve) - §2: Host control (OnHostUpdated merge, validateHost, preCheck, batch ops) - §3: Resource value push (all 7 value types, nil/unknown discriminant, overwrite) - §4: Heartbeat keep-alive (interval update, zero-preserve) - §5: Cross-feature (config+heartbeat, config+host, worker+config field preservation) - §6: RBAC (cluster_admin bypass, algorithm confusion, expired tokens, hostgroup bypass) - §7: Store thread safety (concurrent config pushes, host control+config, resource values) - §8: Input safety (hostname length, empty lists, malformed payloads) All tests use CGO_ENABLED=0 with //go:build !cgo build tag. §8.1 hostname-length skipped pending P1-2b implementation.
This commit is contained in:
parent
0a3de8b040
commit
86a65d640a
8 changed files with 1805 additions and 24 deletions
19
src/frontend/apiserver/backend/val_helpers.h
Normal file
19
src/frontend/apiserver/backend/val_helpers.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef VAL_HELPERS_H
|
||||
#define VAL_HELPERS_H
|
||||
|
||||
#include "xce/types.h"
|
||||
|
||||
// Thin accessors for xce_val_t union fields.
|
||||
// CGO cannot access C union fields by name (they appear as [N]byte in Go),
|
||||
// so these helpers extract typed values without unsafe pointer arithmetic.
|
||||
|
||||
static inline int xce_val_which(xce_val_t *v) { return v->which; }
|
||||
static inline int32_t xce_val_i32(xce_val_t *v) { return v->u.ivalue32; }
|
||||
static inline int64_t xce_val_i64(xce_val_t *v) { return v->u.ivalue64; }
|
||||
static inline uint32_t xce_val_u32(xce_val_t *v) { return v->u.uvalue32; }
|
||||
static inline uint64_t xce_val_u64(xce_val_t *v) { return v->u.uvalue64; }
|
||||
static inline double xce_val_fval(xce_val_t *v) { return v->u.fvalue; }
|
||||
static inline char* xce_val_str(xce_val_t *v) { return v->u.svalue; }
|
||||
static inline int xce_val_bool(xce_val_t *v) { return v->u.bvalue; }
|
||||
|
||||
#endif /* VAL_HELPERS_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue