diff options
author | Peter Simons <simons@cryp.to> | 2017-10-18 12:58:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 12:58:55 +0100 |
commit | 757a759005181f93ea9dca246e6f026402bbb8de (patch) | |
tree | 95a78577e539dfb2859312ef5b3d4bf576a906bb /nixos/lib | |
parent | 7d5c5eb203bbebdfb0165522b46f2af41285337b (diff) | |
parent | 5b8ff5ed4914642027422dd1956f2068cfbe95fd (diff) | |
download | nixlib-757a759005181f93ea9dca246e6f026402bbb8de.tar nixlib-757a759005181f93ea9dca246e6f026402bbb8de.tar.gz nixlib-757a759005181f93ea9dca246e6f026402bbb8de.tar.bz2 nixlib-757a759005181f93ea9dca246e6f026402bbb8de.tar.lz nixlib-757a759005181f93ea9dca246e6f026402bbb8de.tar.xz nixlib-757a759005181f93ea9dca246e6f026402bbb8de.tar.zst nixlib-757a759005181f93ea9dca246e6f026402bbb8de.zip |
Merge pull request #30166 from LumiGuide/graphite-1.0.2
Fix graphite crash by upgrading from 0.9.15 -> 1.0.2
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/test-driver/Machine.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/lib/test-driver/Machine.pm b/nixos/lib/test-driver/Machine.pm index cd375352c4ca..a7ed5d1faa38 100644 --- a/nixos/lib/test-driver/Machine.pm +++ b/nixos/lib/test-driver/Machine.pm @@ -372,6 +372,17 @@ sub getUnitInfo { return $info; } +# Fail if the given systemd unit is not in the "active" state. +sub requireActiveUnit { + my ($self, $unit) = @_; + $self->nest("checking if unit ‘$unit’ has reached state 'active'", sub { + my $info = $self->getUnitInfo($unit); + my $state = $info->{ActiveState}; + if ($state ne "active") { + die "Expected unit ‘$unit’ to to be in state 'active' but it is in state ‘$state’\n"; + }; + }); +} # Wait for a systemd unit to reach the "active" state. sub waitForUnit { |