File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env zsh
2
+ # usage: list-runner-vms.sh
3
+ script_dir=${0: a: h}
4
+ . " $script_dir /common.sh"
5
+
6
+ zfs list -Ho name -rt volume $SERVO_CI_ZFS_PREFIX
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ fn main() -> eyre::Result<()> {
40
40
41
41
dbg ! ( list_registered_runners_for_host( ) ?) ;
42
42
dbg ! ( list_runner_guests( ) ?) ;
43
+ dbg ! ( list_runner_volumes( ) ?) ;
43
44
44
45
Ok ( ( ) )
45
46
}
@@ -87,3 +88,25 @@ fn list_runner_guests() -> eyre::Result<Vec<String>> {
87
88
88
89
Ok ( result. collect ( ) )
89
90
}
91
+
92
+ fn list_runner_volumes ( ) -> eyre:: Result < Vec < String > > {
93
+ let output = Command :: new ( "../list-runner-volumes.sh" )
94
+ . stdout ( Stdio :: piped ( ) )
95
+ . spawn ( )
96
+ . unwrap ( )
97
+ . wait_with_output ( )
98
+ . unwrap ( ) ;
99
+ if !output. status . success ( ) {
100
+ eyre:: bail!( "Command exited with status {}" , output. status) ;
101
+ }
102
+
103
+ // Output is already filtered by prefix, but filter again just in case.
104
+ let prefix = format ! ( "{}/" , env:: var( "SERVO_CI_ZFS_PREFIX" ) ?) ;
105
+ let result = str:: from_utf8 ( & output. stdout )
106
+ . wrap_err ( "Failed to decode UTF-8" ) ?
107
+ . split_terminator ( '\n' )
108
+ . filter ( |name| name. starts_with ( & prefix) )
109
+ . map ( str:: to_owned) ;
110
+
111
+ Ok ( result. collect ( ) )
112
+ }
You can’t perform that action at this time.
0 commit comments