Skip to content

Commit 41dda8f

Browse files
committed
test update to include mount check
Signed-off-by: Pooja Mahadev Soundalgekar <pomahade@microsoft.com>
1 parent 0c807d6 commit 41dda8f

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

pkg/cimfs/cim_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,10 @@ func TestMergedVerifiedBlockCIMs(rootT *testing.T) {
781781
rootT.Skipf("verified BlockCIMs are not supported")
782782
}
783783

784+
if !IsVerifiedCimMountSupported() {
785+
rootT.Skipf("verified BlockCIMs are not supported")
786+
}
787+
784788
// A slice of 3 slices, 1 slice for contents of each CIM
785789
testContents := [][]tuple{
786790
{{"foo.txt", []byte("foo1"), false}},

pkg/cimfs/cimfs.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,19 @@ func IsBlockCimSupported() bool {
3737
// IsBlockCimWriteSupported returns true if block formatted CIMs (i.e block device CIM &
3838
// single file CIM) are supported on the current OS build or if CimWriter is present.
3939
func IsBlockCimWriteSupported() bool {
40-
build := osversion.Build()
4140
// TODO(ambarve): Currently we are checking against a higher build number since there is no
4241
// official build with block CIM support yet. Once we have that build, we should
4342
// update the build number here.
44-
return (build >= 27766 && cimfs.Supported()) || cimwriter.Supported()
43+
return IsBlockCimSupported() || cimwriter.Supported()
4544
}
4645

4746
// IsBlockCimMountSupported returns true if block formatted CIMs (i.e block device CIM &
4847
// single file CIM) are supported on the current OS build.
4948
func IsBlockCimMountSupported() bool {
50-
build := osversion.Build()
5149
// TODO(ambarve): Currently we are checking against a higher build number since there is no
5250
// official build with block CIM support yet. Once we have that build, we should
5351
// update the build number here.
54-
return build >= 27766 && cimfs.Supported()
52+
return IsBlockCimSupported()
5553
}
5654

5755
// IsVerifiedCimSupported returns true if block CIM format supports also writing verification information in the CIM.
@@ -63,23 +61,20 @@ func IsVerifiedCimSupported() bool {
6361
return build >= 27800 && cimfs.Supported()
6462
}
6563

66-
6764
// IsVerifiedCimWriteSupported returns true if block CIM format supports also writing verification information in the CIM.
6865
func IsVerifiedCimWriteSupported() bool {
69-
build := osversion.Build()
7066
// TODO(ambarve): Currently we are checking against a higher build number since there is no
7167
// official build with block CIM support yet. Once we have that build, we should
7268
// update the build number here.
73-
return (build >= 27800 && cimfs.Supported()) || cimwriter.Supported()
69+
return IsVerifiedCimSupported() || cimwriter.Supported()
7470
}
7571

7672
// IsVerifiedCimMountSupported returns true if block CIM format supports mounting.
7773
func IsVerifiedCimMountSupported() bool {
78-
build := osversion.Build()
7974
// TODO(ambarve): Currently we are checking against a higher build number since there is no
8075
// official build with block CIM support yet. Once we have that build, we should
8176
// update the build number here.
82-
return build >= 27800 && cimfs.Supported()
77+
return IsVerifiedCimSupported()
8378
}
8479

8580
func IsMergedCimSupported() bool {
@@ -102,6 +97,7 @@ func IsMergedCimMountSupported() bool {
10297
// later along with block CIM support. So use the same check as block CIM here.
10398
return IsBlockCimMountSupported()
10499
}
100+
105101
type BlockCIMType uint32
106102

107103
const (

0 commit comments

Comments
 (0)