File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 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<()> {
4040
4141 dbg ! ( list_registered_runners_for_host( ) ?) ;
4242 dbg ! ( list_runner_guests( ) ?) ;
43+ dbg ! ( list_runner_volumes( ) ?) ;
4344
4445 Ok ( ( ) )
4546}
@@ -87,3 +88,25 @@ fn list_runner_guests() -> eyre::Result<Vec<String>> {
8788
8889 Ok ( result. collect ( ) )
8990}
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