mabi-core 1.6.2

Mabinogion - Core abstractions and utilities for industrial protocol simulator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
//! Pre-built simulation scenarios.
//!
//! Provides ready-to-use scenarios for common testing patterns.

use std::time::Duration;

use serde::{Deserialize, Serialize};

use super::failure::{FailureConfig, FailureSchedule, FailureType};
use super::load::LoadPattern;
use super::memory_sim::MemoryPattern;
use super::scale::ScaleConfig;
use super::SimulationConfig;

/// Pre-built simulation scenarios.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum Scenario {
    /// Quick smoke test.
    SmokeTest,

    /// Basic functionality test.
    BasicFunctionality,

    /// Stress test with high load.
    StressTest,

    /// Memory leak detection scenario.
    MemoryLeakDetection,

    /// Chaos engineering scenario.
    ChaosEngineering,

    /// Long-running stability test.
    Endurance,

    /// Scale-up test (increasing load).
    ScaleUp,

    /// Production-like daily traffic.
    ProductionSimulation,

    /// Peak load test.
    PeakLoad,

    /// Failure recovery test.
    FailureRecovery,

    /// Custom scenario.
    Custom(Box<SimulationConfig>),
}

impl Scenario {
    /// Convert scenario to simulation configuration.
    pub fn to_config(&self) -> SimulationConfig {
        match self {
            Self::SmokeTest => smoke_test_config(),
            Self::BasicFunctionality => basic_functionality_config(),
            Self::StressTest => stress_test_config(),
            Self::MemoryLeakDetection => memory_leak_detection_config(),
            Self::ChaosEngineering => chaos_engineering_config(),
            Self::Endurance => endurance_config(),
            Self::ScaleUp => scale_up_config(),
            Self::ProductionSimulation => production_simulation_config(),
            Self::PeakLoad => peak_load_config(),
            Self::FailureRecovery => failure_recovery_config(),
            Self::Custom(config) => (**config).clone(),
        }
    }

    /// Get scenario name.
    pub fn name(&self) -> &'static str {
        match self {
            Self::SmokeTest => "Smoke Test",
            Self::BasicFunctionality => "Basic Functionality",
            Self::StressTest => "Stress Test",
            Self::MemoryLeakDetection => "Memory Leak Detection",
            Self::ChaosEngineering => "Chaos Engineering",
            Self::Endurance => "Endurance Test",
            Self::ScaleUp => "Scale-Up Test",
            Self::ProductionSimulation => "Production Simulation",
            Self::PeakLoad => "Peak Load Test",
            Self::FailureRecovery => "Failure Recovery",
            Self::Custom(_) => "Custom Scenario",
        }
    }

    /// Get scenario description.
    pub fn description(&self) -> &'static str {
        match self {
            Self::SmokeTest => "Quick test to verify basic system operation",
            Self::BasicFunctionality => "Tests core functionality with moderate load",
            Self::StressTest => "High load test to find breaking points",
            Self::MemoryLeakDetection => "Extended test to detect memory leaks",
            Self::ChaosEngineering => "Random failure injection to test resilience",
            Self::Endurance => "Long-running test for stability verification",
            Self::ScaleUp => "Gradually increasing load to test scaling",
            Self::ProductionSimulation => "Simulates realistic production traffic patterns",
            Self::PeakLoad => "Tests maximum expected load handling",
            Self::FailureRecovery => "Tests system recovery from various failures",
            Self::Custom(_) => "User-defined custom scenario",
        }
    }

    /// Get estimated duration.
    pub fn estimated_duration(&self) -> Duration {
        match self {
            Self::SmokeTest => Duration::from_secs(60),
            Self::BasicFunctionality => Duration::from_secs(300),
            Self::StressTest => Duration::from_secs(600),
            Self::MemoryLeakDetection => Duration::from_secs(3600),
            Self::ChaosEngineering => Duration::from_secs(1800),
            Self::Endurance => Duration::from_secs(86400), // 24 hours
            Self::ScaleUp => Duration::from_secs(1200),
            Self::ProductionSimulation => Duration::from_secs(86400), // 24 hours
            Self::PeakLoad => Duration::from_secs(300),
            Self::FailureRecovery => Duration::from_secs(900),
            Self::Custom(config) => config.max_duration,
        }
    }

    /// List all built-in scenarios.
    pub fn all_builtin() -> Vec<Self> {
        vec![
            Self::SmokeTest,
            Self::BasicFunctionality,
            Self::StressTest,
            Self::MemoryLeakDetection,
            Self::ChaosEngineering,
            Self::Endurance,
            Self::ScaleUp,
            Self::ProductionSimulation,
            Self::PeakLoad,
            Self::FailureRecovery,
        ]
    }
}

/// Quick smoke test - 1 minute, minimal load.
fn smoke_test_config() -> SimulationConfig {
    SimulationConfig {
        name: "Smoke Test".to_string(),
        description: "Quick verification of basic system operation".to_string(),
        scale: ScaleConfig::tiny(),
        memory_pattern: MemoryPattern::Steady,
        load_pattern: LoadPattern::steady(100),
        failure_config: None,
        max_duration: Duration::from_secs(60),
        report_interval: Duration::from_secs(10),
        detailed_metrics: true,
        seed: None,
    }
}

/// Basic functionality test - 5 minutes, moderate load.
fn basic_functionality_config() -> SimulationConfig {
    SimulationConfig {
        name: "Basic Functionality".to_string(),
        description: "Core functionality test with moderate load".to_string(),
        scale: ScaleConfig::small(),
        memory_pattern: MemoryPattern::Steady,
        load_pattern: LoadPattern::ramp(100, 1000, Duration::from_secs(60)),
        failure_config: None,
        max_duration: Duration::from_secs(300),
        report_interval: Duration::from_secs(30),
        detailed_metrics: true,
        seed: None,
    }
}

/// Stress test - 10 minutes, high load.
fn stress_test_config() -> SimulationConfig {
    SimulationConfig {
        name: "Stress Test".to_string(),
        description: "High load test to find breaking points".to_string(),
        scale: ScaleConfig::large(),
        memory_pattern: MemoryPattern::HighChurn,
        load_pattern: LoadPattern::ramp(1000, 100000, Duration::from_secs(300)),
        failure_config: None,
        max_duration: Duration::from_secs(600),
        report_interval: Duration::from_secs(30),
        detailed_metrics: true,
        seed: None,
    }
}

/// Memory leak detection - 1 hour, stable load.
fn memory_leak_detection_config() -> SimulationConfig {
    SimulationConfig {
        name: "Memory Leak Detection".to_string(),
        description: "Extended test to detect memory leaks".to_string(),
        scale: ScaleConfig::medium(),
        memory_pattern: MemoryPattern::GrowthOnly,
        load_pattern: LoadPattern::steady(5000),
        failure_config: None,
        max_duration: Duration::from_secs(3600),
        report_interval: Duration::from_secs(60),
        detailed_metrics: true,
        seed: None,
    }
}

/// Chaos engineering - 30 minutes, random failures.
fn chaos_engineering_config() -> SimulationConfig {
    SimulationConfig {
        name: "Chaos Engineering".to_string(),
        description: "Random failure injection to test resilience".to_string(),
        scale: ScaleConfig::medium(),
        memory_pattern: MemoryPattern::GrowthAndRelease,
        load_pattern: LoadPattern::wave(5000, 2000, Duration::from_secs(300)),
        failure_config: Some(FailureConfig {
            enabled: true,
            failure_rate: 0.05, // 5% failure rate
            failure_types: vec![
                FailureType::Timeout,
                FailureType::ConnectionReset,
                FailureType::ProtocolError,
                FailureType::DeviceOffline,
                FailureType::SlowResponse {
                    delay: Duration::from_secs(5),
                },
            ],
            schedule: FailureSchedule::Random {
                min_interval: Duration::from_secs(10),
                max_interval: Duration::from_secs(60),
            },
            cascade_probability: 0.1,
            recovery_time: Duration::from_secs(30),
            max_concurrent_failures: 10,
            seed: None,
        }),
        max_duration: Duration::from_secs(1800),
        report_interval: Duration::from_secs(60),
        detailed_metrics: true,
        seed: None,
    }
}

/// Endurance test - 24 hours, steady load.
fn endurance_config() -> SimulationConfig {
    SimulationConfig {
        name: "Endurance Test".to_string(),
        description: "Long-running test for stability verification".to_string(),
        scale: ScaleConfig::medium(),
        memory_pattern: MemoryPattern::GrowthAndRelease,
        load_pattern: LoadPattern::DailyTraffic {
            peak: 10000,
            off_peak: 2000,
            day_duration: Duration::from_secs(86400),
        },
        failure_config: Some(FailureConfig {
            enabled: true,
            failure_rate: 0.001, // 0.1% failure rate
            failure_types: vec![FailureType::Timeout, FailureType::ConnectionReset],
            schedule: FailureSchedule::Random {
                min_interval: Duration::from_secs(300),
                max_interval: Duration::from_secs(3600),
            },
            cascade_probability: 0.01,
            recovery_time: Duration::from_secs(60),
            max_concurrent_failures: 5,
            seed: None,
        }),
        max_duration: Duration::from_secs(86400), // 24 hours
        report_interval: Duration::from_secs(3600),
        detailed_metrics: true,
        seed: None,
    }
}

/// Scale-up test - 20 minutes, increasing load.
fn scale_up_config() -> SimulationConfig {
    SimulationConfig {
        name: "Scale-Up Test".to_string(),
        description: "Gradually increasing load to test scaling".to_string(),
        scale: ScaleConfig::xlarge(),
        memory_pattern: MemoryPattern::GrowthOnly,
        load_pattern: LoadPattern::Step {
            initial: 1000,
            steps: vec![
                (Duration::from_secs(120), 5000),
                (Duration::from_secs(240), 10000),
                (Duration::from_secs(360), 25000),
                (Duration::from_secs(480), 50000),
                (Duration::from_secs(600), 75000),
                (Duration::from_secs(720), 100000),
            ],
        },
        failure_config: None,
        max_duration: Duration::from_secs(1200),
        report_interval: Duration::from_secs(60),
        detailed_metrics: true,
        seed: None,
    }
}

/// Production simulation - 24 hours, realistic traffic.
fn production_simulation_config() -> SimulationConfig {
    SimulationConfig {
        name: "Production Simulation".to_string(),
        description: "Simulates realistic production traffic patterns".to_string(),
        scale: ScaleConfig::large(),
        memory_pattern: MemoryPattern::GrowthAndRelease,
        load_pattern: LoadPattern::DailyTraffic {
            peak: 50000,
            off_peak: 5000,
            day_duration: Duration::from_secs(86400),
        },
        failure_config: Some(FailureConfig {
            enabled: true,
            failure_rate: 0.0001, // 0.01% failure rate (realistic)
            failure_types: vec![
                FailureType::Timeout,
                FailureType::SlowResponse {
                    delay: Duration::from_millis(500),
                },
            ],
            schedule: FailureSchedule::Random {
                min_interval: Duration::from_secs(600),
                max_interval: Duration::from_secs(7200),
            },
            cascade_probability: 0.001,
            recovery_time: Duration::from_secs(30),
            max_concurrent_failures: 3,
            seed: None,
        }),
        max_duration: Duration::from_secs(86400), // 24 hours
        report_interval: Duration::from_secs(3600),
        detailed_metrics: true,
        seed: None,
    }
}

/// Peak load test - 5 minutes, maximum expected load.
fn peak_load_config() -> SimulationConfig {
    SimulationConfig {
        name: "Peak Load Test".to_string(),
        description: "Tests maximum expected load handling".to_string(),
        scale: ScaleConfig::xlarge(),
        memory_pattern: MemoryPattern::HighChurn,
        load_pattern: LoadPattern::Spike {
            baseline: 10000,
            peak: 100000,
            spike_duration: Duration::from_secs(120),
        },
        failure_config: None,
        max_duration: Duration::from_secs(300),
        report_interval: Duration::from_secs(15),
        detailed_metrics: true,
        seed: None,
    }
}

/// Failure recovery test - 15 minutes, sequential failures.
fn failure_recovery_config() -> SimulationConfig {
    SimulationConfig {
        name: "Failure Recovery".to_string(),
        description: "Tests system recovery from various failures".to_string(),
        scale: ScaleConfig::medium(),
        memory_pattern: MemoryPattern::Steady,
        load_pattern: LoadPattern::steady(5000),
        failure_config: Some(FailureConfig {
            enabled: true,
            failure_rate: 0.2, // 20% failure rate (high for testing recovery)
            failure_types: vec![
                FailureType::Timeout,
                FailureType::ConnectionReset,
                FailureType::ConnectionRefused,
                FailureType::ProtocolError,
                FailureType::DeviceOffline,
                FailureType::NetworkPartition,
                FailureType::OutOfMemory,
            ],
            schedule: FailureSchedule::Periodic {
                interval: Duration::from_secs(60),
                duration: Duration::from_secs(10),
            },
            cascade_probability: 0.3,
            recovery_time: Duration::from_secs(30),
            max_concurrent_failures: 20,
            seed: None,
        }),
        max_duration: Duration::from_secs(900),
        report_interval: Duration::from_secs(30),
        detailed_metrics: true,
        seed: None,
    }
}

/// Scenario builder for custom scenarios.
#[derive(Debug, Clone)]
pub struct ScenarioBuilder {
    config: SimulationConfig,
}

impl Default for ScenarioBuilder {
    fn default() -> Self {
        Self::new()
    }
}

impl ScenarioBuilder {
    /// Create a new scenario builder with defaults.
    pub fn new() -> Self {
        Self {
            config: SimulationConfig::default(),
        }
    }

    /// Start from an existing scenario.
    pub fn from_scenario(scenario: Scenario) -> Self {
        Self {
            config: scenario.to_config(),
        }
    }

    /// Set scenario name.
    pub fn name(mut self, name: impl Into<String>) -> Self {
        self.config.name = name.into();
        self
    }

    /// Set scenario description.
    pub fn description(mut self, description: impl Into<String>) -> Self {
        self.config.description = description.into();
        self
    }

    /// Set scale configuration.
    pub fn scale(mut self, scale: ScaleConfig) -> Self {
        self.config.scale = scale;
        self
    }

    /// Set maximum duration.
    pub fn max_duration(mut self, duration: Duration) -> Self {
        self.config.max_duration = duration;
        self
    }

    /// Set load pattern.
    pub fn load_pattern(mut self, pattern: LoadPattern) -> Self {
        self.config.load_pattern = pattern;
        self
    }

    /// Set memory pattern.
    pub fn memory_pattern(mut self, pattern: MemoryPattern) -> Self {
        self.config.memory_pattern = pattern;
        self
    }

    /// Set failure config.
    pub fn failure_config(mut self, config: FailureConfig) -> Self {
        self.config.failure_config = Some(config);
        self
    }

    /// Set report interval.
    pub fn report_interval(mut self, interval: Duration) -> Self {
        self.config.report_interval = interval;
        self
    }

    /// Enable or disable detailed metrics collection.
    pub fn detailed_metrics(mut self, enabled: bool) -> Self {
        self.config.detailed_metrics = enabled;
        self
    }

    /// Set random seed for reproducibility.
    pub fn seed(mut self, seed: u64) -> Self {
        self.config.seed = Some(seed);
        self
    }

    /// Build the scenario.
    pub fn build(self) -> Scenario {
        Scenario::Custom(Box::new(self.config))
    }

    /// Get the configuration directly.
    pub fn into_config(self) -> SimulationConfig {
        self.config
    }
}

/// Scenario suite for running multiple scenarios.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ScenarioSuite {
    /// Suite name.
    pub name: String,

    /// Suite description.
    pub description: Option<String>,

    /// Scenarios in this suite.
    pub scenarios: Vec<Scenario>,

    /// Whether to stop on first failure.
    pub stop_on_failure: bool,

    /// Delay between scenarios.
    pub inter_scenario_delay: Duration,
}

impl ScenarioSuite {
    /// Create a new scenario suite.
    pub fn new(name: impl Into<String>) -> Self {
        Self {
            name: name.into(),
            description: None,
            scenarios: Vec::new(),
            stop_on_failure: false,
            inter_scenario_delay: Duration::from_secs(60),
        }
    }

    /// Add a scenario to the suite.
    pub fn add_scenario(mut self, scenario: Scenario) -> Self {
        self.scenarios.push(scenario);
        self
    }

    /// Set description.
    pub fn description(mut self, description: impl Into<String>) -> Self {
        self.description = Some(description.into());
        self
    }

    /// Set stop on failure behavior.
    pub fn stop_on_failure(mut self, stop: bool) -> Self {
        self.stop_on_failure = stop;
        self
    }

    /// Set delay between scenarios.
    pub fn inter_scenario_delay(mut self, delay: Duration) -> Self {
        self.inter_scenario_delay = delay;
        self
    }

    /// Get total estimated duration.
    pub fn estimated_duration(&self) -> Duration {
        let scenario_time: Duration = self.scenarios.iter().map(|s| s.estimated_duration()).sum();
        let delay_time = self.inter_scenario_delay * self.scenarios.len().saturating_sub(1) as u32;
        scenario_time + delay_time
    }

    /// Create a quick test suite.
    pub fn quick_test() -> Self {
        Self::new("Quick Test Suite")
            .description("Quick validation of core functionality")
            .add_scenario(Scenario::SmokeTest)
            .add_scenario(Scenario::BasicFunctionality)
            .stop_on_failure(true)
            .inter_scenario_delay(Duration::from_secs(10))
    }

    /// Create a full test suite.
    pub fn full_test() -> Self {
        Self::new("Full Test Suite")
            .description("Comprehensive testing of all scenarios")
            .add_scenario(Scenario::SmokeTest)
            .add_scenario(Scenario::BasicFunctionality)
            .add_scenario(Scenario::StressTest)
            .add_scenario(Scenario::MemoryLeakDetection)
            .add_scenario(Scenario::ChaosEngineering)
            .add_scenario(Scenario::ScaleUp)
            .add_scenario(Scenario::PeakLoad)
            .add_scenario(Scenario::FailureRecovery)
            .stop_on_failure(false)
            .inter_scenario_delay(Duration::from_secs(60))
    }

    /// Create a regression test suite.
    pub fn regression_test() -> Self {
        Self::new("Regression Test Suite")
            .description("Standard regression testing")
            .add_scenario(Scenario::SmokeTest)
            .add_scenario(Scenario::BasicFunctionality)
            .add_scenario(Scenario::StressTest)
            .stop_on_failure(true)
            .inter_scenario_delay(Duration::from_secs(30))
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_scenario_configs() {
        for scenario in Scenario::all_builtin() {
            let config = scenario.to_config();
            assert!(!config.name.is_empty());
            assert!(config.max_duration > Duration::ZERO);
        }
    }

    #[test]
    fn test_scenario_metadata() {
        for scenario in Scenario::all_builtin() {
            assert!(!scenario.name().is_empty());
            assert!(!scenario.description().is_empty());
            assert!(scenario.estimated_duration() > Duration::ZERO);
        }
    }

    #[test]
    fn test_scenario_builder() {
        let scenario = ScenarioBuilder::new()
            .name("Custom Test")
            .description("A custom test scenario")
            .scale(ScaleConfig::medium())
            .max_duration(Duration::from_secs(600))
            .load_pattern(LoadPattern::steady(5000))
            .detailed_metrics(true)
            .build();

        let config = scenario.to_config();
        assert_eq!(config.name, "Custom Test");
        assert_eq!(config.max_duration, Duration::from_secs(600));
    }

    #[test]
    fn test_scenario_builder_from_existing() {
        let scenario = ScenarioBuilder::from_scenario(Scenario::StressTest)
            .name("Modified Stress Test")
            .max_duration(Duration::from_secs(1200))
            .build();

        let config = scenario.to_config();
        assert_eq!(config.name, "Modified Stress Test");
        assert_eq!(config.max_duration, Duration::from_secs(1200));
        // Should inherit scale from StressTest
        assert_eq!(config.scale.device_count, ScaleConfig::large().device_count);
    }

    #[test]
    fn test_scenario_suite() {
        let suite = ScenarioSuite::quick_test();

        assert_eq!(suite.scenarios.len(), 2);
        assert!(suite.stop_on_failure);
        assert!(suite.estimated_duration() > Duration::ZERO);
    }

    #[test]
    fn test_full_suite() {
        let suite = ScenarioSuite::full_test();

        assert!(suite.scenarios.len() >= 5);
        assert!(!suite.stop_on_failure);
    }

    #[test]
    fn test_custom_scenario_serialization() {
        let scenario = Scenario::Custom(Box::new(SimulationConfig {
            name: "Serialization Test".to_string(),
            description: "Test serialization".to_string(),
            scale: ScaleConfig::tiny(),
            memory_pattern: MemoryPattern::Steady,
            load_pattern: LoadPattern::steady(100),
            failure_config: None,
            max_duration: Duration::from_secs(60),
            report_interval: Duration::from_secs(10),
            detailed_metrics: true,
            seed: None,
        }));

        let json = serde_json::to_string(&scenario).unwrap();
        let deserialized: Scenario = serde_json::from_str(&json).unwrap();

        let config = deserialized.to_config();
        assert_eq!(config.name, "Serialization Test");
    }

    #[test]
    fn test_suite_estimated_duration() {
        let suite = ScenarioSuite::new("Test")
            .add_scenario(Scenario::SmokeTest)
            .add_scenario(Scenario::BasicFunctionality)
            .inter_scenario_delay(Duration::from_secs(30));

        let expected = Scenario::SmokeTest.estimated_duration()
            + Scenario::BasicFunctionality.estimated_duration()
            + Duration::from_secs(30);

        assert_eq!(suite.estimated_duration(), expected);
    }
}