@@ -12,6 +12,8 @@ use nexus_config::NexusConfig;
12
12
use nexus_test_interface:: NexusServer ;
13
13
use nexus_test_utils:: resource_helpers:: DiskTest ;
14
14
use signal_hook_tokio:: Signals ;
15
+ use std:: fs;
16
+ use std:: os;
15
17
16
18
fn main ( ) -> anyhow:: Result < ( ) > {
17
19
oxide_tokio_rt:: run ( async {
@@ -50,6 +52,9 @@ struct RunAllArgs {
50
52
/// Override the gateway server configuration file.
51
53
#[ clap( long, default_value = DEFAULT_SP_SIM_CONFIG ) ]
52
54
gateway_config : Utf8PathBuf ,
55
+ /// Override the nexus configuration file.
56
+ #[ clap( long, default_value = "./nexus/examples/config.toml" ) ]
57
+ nexus_config : Utf8PathBuf ,
53
58
}
54
59
55
60
impl RunAllArgs {
@@ -60,9 +65,10 @@ impl RunAllArgs {
60
65
let mut signal_stream = signals. fuse ( ) ;
61
66
62
67
// Read configuration.
63
- let config_str = include_str ! ( "../../../nexus/examples/config.toml" ) ;
64
- let mut config: NexusConfig =
65
- toml:: from_str ( config_str) . context ( "parsing example config" ) ?;
68
+ let config_str = fs:: read_to_string ( & self . nexus_config ) ?;
69
+ let mut config: NexusConfig = toml:: from_str ( & config_str) . context (
70
+ format ! ( "parsing config: {}" , self . nexus_config. as_str( ) ) ,
71
+ ) ?;
66
72
config. pkg . log = dropshot:: ConfigLogging :: File {
67
73
// See LogContext::new(),
68
74
path : "UNUSED" . to_string ( ) . into ( ) ,
0 commit comments