diff --git a/perfkitbenchmarker/linux_virtual_machine.py b/perfkitbenchmarker/linux_virtual_machine.py index 94cd21f43..8410b1b31 100644 --- a/perfkitbenchmarker/linux_virtual_machine.py +++ b/perfkitbenchmarker/linux_virtual_machine.py @@ -2167,7 +2167,13 @@ def GetNVMEDeviceInfo(self): self.InstallPackages('nvme-cli') version_str, _ = self.RemoteCommand('sudo nvme --version') version_num = version_str.split()[2] - if packaging_version.parse(version_num) >= packaging_version.parse('1.5'): + # TODO(arushigaur): Version check can be removed and we can just parse + # the raw output. + if packaging_version.parse(version_num) >= packaging_version.parse( + '1.5' + ) and packaging_version.parse(version_num) < packaging_version.parse( + '2.11' + ): stdout, _ = self.RemoteCommand('sudo nvme list --output-format json') if not stdout: return [] diff --git a/tests/providers/gcp/gce_disk_test.py b/tests/providers/gcp/gce_disk_test.py index b691e5a28..ca31dac30 100644 --- a/tests/providers/gcp/gce_disk_test.py +++ b/tests/providers/gcp/gce_disk_test.py @@ -236,7 +236,11 @@ def testPdStandardOnLinux(self): fake_rets = [ ('stdout', 'stderr', 0), ('stdout', 'stderr', 0), - ('20 20 201', 'stderr', 0), + ( + 'nvme version 2.8 (git 2.8)\nlibnvme version 1.8 (git 1.8)', + 'stderr', + 0, + ), ('', 'stderr', 0), ('/dev/nvme0n1', 'stderr', 0), ('0', 'stderr', 0), @@ -295,7 +299,11 @@ def testPdExtremeOnCreateWithVMLinux(self): ('', '', 0), ('stdout', 'stderr', 0), ('stdout', 'stderr', 0), - ('20 20 201', 'stderr', 0), + ( + 'nvme version 2.8 (git 2.8)\nlibnvme version 1.8 (git 1.8)', + 'stderr', + 0, + ), ('', 'stderr', 0), ('/dev/nvme0n1', 'stderr', 0), ('0', 'stderr', 0),