Compose cold-start resources under Runtime Supervisor ownership

This commit is contained in:
ms2k 2026-07-16 17:29:23 +09:00
commit 33ac0ba4ee

View file

@ -17,7 +17,8 @@ use lazaret_core::records::{
SessionRegistrationResponse, TlsCredential,
};
use lazaret_host_coordinator::control::{
CONTROL_ALPN, ControlError, PendingClientEnrollment, PublishedControlFace, TrustAnchor,
CONTROL_ALPN, ControlError, PendingClientEnrollment, PublishedControlFace, SessionRegistry,
StagedControlFace, TrustAnchor,
};
use lazaret_host_coordinator::domain_store::{DomainStoreMutation, HostCoordinatorDomainStore};
use lazaret_linux::filesystem::try_exclusive_flock;
@ -687,26 +688,15 @@ fn prepared_control_face_admits_only_after_generation_publication() {
let directory = TestDirectory::new("publication-gate");
let identity = generation_identity(7);
let store = open_preparing_store(&directory, &identity);
let face = Arc::new(
PublishedControlFace::publish(
&directory.0,
getuid().as_raw(),
TrustAnchor::create(identity.clone()).unwrap(),
Arc::clone(&store),
)
.unwrap(),
);
let serving = server(&face);
let config = PublishedControlFace::client_config(face.publication_identity(), None).unwrap();
assert!(
PublishedControlFace::connect(face.socket_path(), config, face.publication_identity())
.is_err()
);
assert!(matches!(
serving.join().unwrap().unwrap_err(),
ControlError::StaleGeneration
));
let registry = Arc::new(SessionRegistry::new(Arc::clone(&store), identity.clone()));
let staged = StagedControlFace::stage(
&directory.0,
getuid().as_raw(),
TrustAnchor::create(identity.clone()).unwrap(),
registry,
)
.unwrap();
assert!(std::os::unix::net::UnixStream::connect(directory.path("control.sock")).is_err());
store
.apply(&[DomainStoreMutation::PutGeneration(generation(
@ -714,6 +704,7 @@ fn prepared_control_face_admits_only_after_generation_publication() {
DurableDecision::Published,
))])
.unwrap();
let face = Arc::new(staged.expose().unwrap());
let client = enroll(&face, ClientId::new(bytes(90)));
assert_eq!(client.credential.generation_identity, identity);
}