diff options
-rw-r--r-- | lib/OperatingSystems/DefaultOs.php | 2 | ||||
-rw-r--r-- | tests/data/df_tp | 1 | ||||
-rw-r--r-- | tests/lib/DefaultOsTest.php | 8 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/OperatingSystems/DefaultOs.php b/lib/OperatingSystems/DefaultOs.php index 650fc4a..ed0a665 100644 --- a/lib/OperatingSystems/DefaultOs.php +++ b/lib/OperatingSystems/DefaultOs.php @@ -209,7 +209,7 @@ class DefaultOs implements IOperatingSystem { } $matches = []; - $pattern = '/^(?<Filesystem>[\w\/-]+)\s*(?<Type>\w+)\s*(?<Blocks>\d+)\s*(?<Used>\d+)\s*(?<Available>\d+)\s*(?<Capacity>\d+%)\s*(?<Mounted>[\w\/-]+)$/m'; + $pattern = '/^(?<Filesystem>[\S]+)\s*(?<Type>\w+)\s*(?<Blocks>\d+)\s*(?<Used>\d+)\s*(?<Available>\d+)\s*(?<Capacity>\d+%)\s*(?<Mounted>[\w\/-]+)$/m'; $result = preg_match_all($pattern, $disks, $matches); if ($result === 0 || $result === false) { diff --git a/tests/data/df_tp b/tests/data/df_tp index 4eaf3b4..4d9cbb3 100644 --- a/tests/data/df_tp +++ b/tests/data/df_tp @@ -9,3 +9,4 @@ tmpfs tmpfs 4084000 0 4084000 vagrant vboxsf 958123168 614831132 343292036 65% /vagrant home_vagrant_code vboxsf 958123168 614831132 343292036 65% /home/vagrant/code tmpfs tmpfs 816800 0 816800 0% /run/user/1000 +nfs.example.com:/export nfs4 14820 0 1230 0% /nfs diff --git a/tests/lib/DefaultOsTest.php b/tests/lib/DefaultOsTest.php index 7f3eb6c..790b7ae 100644 --- a/tests/lib/DefaultOsTest.php +++ b/tests/lib/DefaultOsTest.php @@ -166,6 +166,14 @@ class DefaultOsTest extends TestCase { 'percent' => '65%', 'mount' => '/home/vagrant/code', ], + [ + 'device' => 'nfs.example.com:/export', + 'fs' => 'nfs4', + 'used' => 0, + 'available' => 1259520, + 'percent' => '0%', + 'mount' => '/nfs', + ] ]; $this->assertSame($disks, $this->os->getDiskInfo()); |