pub struct TestStore { /* private fields */ }Implementations§
Source§impl TestStore
impl TestStore
pub fn root(&self) -> StoreRootRef
pub async fn execute_unscoped_host_sql_for_test( &self, sql: impl Into<String>, ) -> Result<(), HostWriteError<DbError>>
pub async fn bind_founder_device( &self, database: &Database, store_dir: StoreDir, ) -> Result<TestDevice, StoreError>
pub async fn open_store_with_identity( &self, database: &Database, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<Store, StoreInitializationError>
pub async fn open_store_with_storage( &self, database: StoreDatabase, storage: Arc<dyn CloudSyncObjectStorage>, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<Store, StoreInitializationError>
pub async fn open_founder_store_with_storage( &self, database: StoreDatabase, storage: Arc<dyn CloudSyncObjectStorage>, store_dir: StoreDir, ) -> Result<Store, StoreInitializationError>
pub fn tombstone_deletions(&self) -> Vec<String>
pub fn tombstone_provider_key(&self, stored: &StoredBlobRef) -> String
pub fn stored_tombstone_bytes(&self, key: &str) -> Option<Vec<u8>>
pub async fn plant_tombstone_bytes( &self, key: &str, bytes: Vec<u8>, ) -> Result<(), StorageError>
Sourcepub async fn plant_tombstone(&self, tombstone: &BlobTombstoneJson)
pub async fn plant_tombstone(&self, tombstone: &BlobTombstoneJson)
Plants a typed tombstone through the Store’s exact cloud layout while bypassing the signing drain, so deletion tests can exercise rejected signatures and Store identities.
pub fn fail_exact_delete_on_call(&self, call: usize)
pub fn fail_nth_exact_delete_of(&self, slots: &[&ObjectSlot], call: usize)
pub fn sort_provider_listings(&self)
pub fn provider_object_is_absent(&self, logical_key: &str) -> bool
pub fn arm_provider_write_failures(&self)
pub fn fail_exact_create_before_call(&self, call: usize)
pub fn exact_creates(&self) -> Vec<ObjectSlot>
pub fn clear_exact_creates(&self)
pub fn fail_exact_create_after_call(&self, call: usize)
pub fn pause_after_exact_create_call( &self, call: usize, ) -> (Arc<Notify>, Arc<Notify>)
pub async fn pull_with_storage_for_test( &self, database: &Database, storage: Arc<dyn CloudSyncObjectStorage>, store_dir: &StoreDir, routing_encryption: Option<&EncryptionService>, ) -> Result<StorePullResult, SyncCycleFailure>
pub async fn create_circle( &self, metadata_stamp: &str, name: &str, ) -> Result<CircleId, CircleOperationError>
pub async fn run_founder_cycle( &self, observer: Option<&dyn BlobTransitionObserver>, ) -> Result<SyncCycleResult, SyncCycleFailure>
pub async fn publish_fixture_position(&self, note_id: &str) -> u64
pub async fn create_exact_opaque_blob( &self, namespace: &str, id: &str, bytes: &[u8], ) -> StoredBlobRef
pub async fn create_exact_browsable_blob( &self, namespace: &str, id: &str, cloud_path: &str, bytes: &[u8], ) -> StoredBlobRef
pub async fn publish_exact_remote_blob_binding( &self, root_id: &str, row_id: &str, bytes: &[u8], ) -> StoredBlobRef
pub async fn pull_into_result( &self, db: &Database, store_dir: &StoreDir, ) -> Result<(BTreeMap<String, u64>, StorePullResult), TestPullError>
pub async fn pull_into( &self, db: &Database, store_dir: &StoreDir, ) -> (BTreeMap<String, u64>, StorePullResult)
Sourcepub async fn pull_and_fill_into(
&self,
db: &Database,
store_dir: &StoreDir,
) -> (BTreeMap<String, u64>, StorePullResult)
pub async fn pull_and_fill_into( &self, db: &Database, store_dir: &StoreDir, ) -> (BTreeMap<String, u64>, StorePullResult)
Pull, then run the eager cache fill the sync loop runs behind its cycles.
A pull records what its rows bind and downloads none of it, so a test that wants an eager blob’s bytes on disk has to do what the loop does.
pub async fn promote_active_member_fixture( &self, owner_db: &Database, owner_db_store_dir: StoreDir, member_db: &Database, member_db_store_dir: StoreDir, owner: &UserKeypair, member: &UserKeypair, encryption: &EncryptionService, ) -> Result<StoreMembershipStateRef, TestError>
pub async fn create( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<Arc<Self>, TestError>
pub async fn create_with_connection( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<TestStoreParts, TestError>
pub async fn create_encrypted( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, encryption: EncryptionService, ) -> Result<Arc<Self>, TestError>
pub async fn create_encrypted_with_connection( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, encryption: EncryptionService, ) -> Result<TestStoreParts, TestError>
pub async fn create_with_database( database: StoreDatabase, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<Arc<Self>, TestError>
Sourcepub async fn create_browsable(
db: &Database,
store_dir: StoreDir,
store_id: &str,
signer: UserKeypair,
home: Arc<InMemoryCloudHome>,
) -> Result<Arc<Self>, TestError>
pub async fn create_browsable( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<Arc<Self>, TestError>
A store whose home keeps blobs browsable: stored in the clear under
readable paths. The counterpart of Self::create, whose home is opaque
(sealed under the store key, hashed paths). The pair is fixed per home,
so a test that needs the browsable verification story needs this store.
pub async fn create_browsable_with_connection( db: &Database, store_dir: StoreDir, store_id: &str, signer: UserKeypair, home: Arc<InMemoryCloudHome>, ) -> Result<TestStoreParts, TestError>
Sourcepub fn delay_exact_full_reads(&self, delay: Duration)
pub fn delay_exact_full_reads(&self, delay: Duration)
Provider operations asked for so far. The unit the cycle log reports in, so a budget written here is the budget read there. Delay every whole-object read and record how many overlap, so a test can assert on the schedule of reads rather than on wall-clock time.
pub fn exact_full_read_max_inflight(&self) -> usize
pub fn exact_reads(&self) -> Vec<ObjectSlot>
pub fn clear_exact_reads(&self)
pub fn provider_requests_issued(&self) -> u64
pub fn protocol_founder_pubkey(&self) -> String
pub async fn create_exact_protocol_object( &self, context: &ProtocolObjectContext, semantic_prefix: &str, extension: &str, bytes: &[u8], ) -> Result<ExactObjectRef, TestError>
Sourcepub async fn publish_exact_protocol_object(
&self,
object: &ExactObjectRef,
bytes: Vec<u8>,
) -> Result<(), StorageError>
pub async fn publish_exact_protocol_object( &self, object: &ExactObjectRef, bytes: Vec<u8>, ) -> Result<(), StorageError>
Publish one object from the bytes and reference that identify it, for tests holding a candidate that carries references rather than uploads.
pub async fn publish_prepared_protocol_object( &self, prepared: &PreparedExactObject, ) -> Result<(), StorageError>
pub async fn read_exact_protocol_object( &self, context: &ProtocolObjectContext, object: &ExactObjectRef, semantic_prefix: &str, ) -> Result<Vec<u8>, StorageError>
pub async fn contains_blob_object(&self, reference: &RowBlobRef) -> bool
pub async fn contains_stored_blob_object( &self, stored: &StoredBlobRef, ) -> Result<bool, StorageError>
pub async fn contains_blob_tombstone( &self, stored: &StoredBlobRef, ) -> Result<bool, CloudHomeError>
pub async fn contains_membership_rollup( &self, rollup: &MembershipRollupRef, ) -> Result<bool, TestError>
pub async fn contains_circle_snapshot_image( &self, circle_id: CircleId, meta: &CircleSnapshotMeta, ) -> Result<bool, TestError>
pub async fn circle_package_in( &self, commit_ref: &StoreBatchCommitRef, ) -> CirclePackageRef
pub async fn circle_package_object_present( &self, package: &CirclePackageRef, activation: &StoreBatchCommitRef, ) -> bool
pub async fn publish_competing_store_head( &self, journal: &CircleOperationJournal, ) -> (ExactObjectRef, ExactObjectRef)
pub async fn publish_third_candidate_winner( &self, peer_db: &Database, candidate: &BlockedMergeCandidate, )
pub async fn overwrite_membership_head( &self, reference: &MembershipHeadRef, head: &AuthorHead, )
pub async fn delete_membership_head_for_test( &self, reference: &MembershipHeadRef, ) -> Result<(), StorageError>
pub async fn pending_device_join_observation( &self, pending: &DeviceJoinJournalDatabase, offer: &DeviceJoinOffer, ) -> Result<PendingDeviceJoinObservation<'_>, TestError>
pub async fn open_pending_device_join( &self, pending: &DeviceJoinJournalDatabase, identity: &UserKeypair, offer: DeviceJoinOffer, ) -> Result<PendingDeviceJoinAuthority<'_>, TestError>
pub async fn prepare_snapshot_bootstrap<'a>( &'a self, membership_floor: &MembershipFloor, binary_schema_version: u32, target_path: &Path, restorer_identity: &UserKeypair, ) -> Result<PreparedSnapshotBootstrap<'a>, SnapshotError>
pub async fn bind_device_in( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<TestDevice, StoreError>
pub async fn bind_device( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<TestDevice, StoreError>
pub async fn drain_uploads( &self, database: &StoreDatabase, store_dir: &StoreDir, clock: &dyn Clock, routing_encryption: Option<&EncryptionService>, observer: Option<&dyn BlobTransitionObserver>, ) -> Result<DrainOutcome, TestError>
pub async fn activate_joined_device( &self, observer_db: &Database, observer_store_dir: StoreDir, joining_db: &Database, joining_store_dir: StoreDir, joining_identity: &UserKeypair, published_at: &str, ) -> Result<TestDevice, TestError>
pub async fn bind_store_device( &self, database: &StoreDatabase, store_dir: StoreDir, identity: &UserKeypair, ) -> Result<TestDevice, TestError>
pub async fn admit_member( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, member_pubkey: &str, member_email: Option<&str>, role: MemberRole, encryption: &EncryptionService, store_name: &str, ) -> Result<MemberAdmission, MembershipOpsError>
pub async fn admit_and_activate_peer( &self, observer_db: &Database, observer_db_store_dir: StoreDir, peer_db: &Database, peer_db_store_dir: StoreDir, peer: &UserKeypair, ) -> Result<TestDevice, TestError>
pub async fn remove_member( &self, db: &Database, store_dir: StoreDir, identity: &UserKeypair, member_pubkey: &str, encryption: &EncryptionService, master_keys: &dyn MasterKeyCustody, ) -> Result<String, MembershipOpsError>
pub async fn device_id(&self, name: &str) -> Result<String, TestError>
pub async fn latest_store_position( &self, ) -> Result<Option<StoreBatchCommitRef>, TestError>
pub async fn load_commit_for_test( &self, reference: &StoreBatchCommitRef, ) -> Result<VerifiedStoreBatchCommit, TestError>
pub async fn load_membership_head_for_test( &self, reference: &MembershipHeadRef, ) -> Result<AuthorHead, TestError>
pub async fn load_registration_for_test( &self, reference: &StoreDeviceRegistrationRef, ) -> Result<StoreDeviceRegistration, TestError>
pub async fn load_store_package_for_test( &self, reference: &StoreBatchCommitRef, ) -> Result<Option<VerifiedObject<Vec<u8>>>, TestError>
pub async fn prepare_founder_store_partition_blob_for_test( &self, fact: &StoreWriteBlobFact, authority: &BlobWriteAuthority<'_>, ) -> Result<(), StoreError>
pub async fn next_commit_sequence(&self, name: &str) -> Result<u64, TestError>
pub async fn open_into( &self, db: &Database, store_dir: StoreDir, ) -> Result<TestDevice, StoreInitializationError>
pub async fn open_into_store_database( &self, database: &StoreDatabase, store_dir: StoreDir, ) -> Result<TestDevice, StoreInitializationError>
pub async fn publish_pending( &self, db: &Database, store_dir: &StoreDir, ) -> Result<bool, TestError>
pub async fn publish_pending_store_database( &self, database: &StoreDatabase, store_dir: &StoreDir, ) -> Result<bool, TestError>
Auto Trait Implementations§
impl Freeze for TestStore
impl !RefUnwindSafe for TestStore
impl Send for TestStore
impl Sync for TestStore
impl Unpin for TestStore
impl UnsafeUnpin for TestStore
impl !UnwindSafe for TestStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more