@@ -112,45 +112,43 @@ func TestGetOSImageVersion(t *testing.T) {
112112
113113func TestIsUserPartitionPreservationSupported (t * testing.T ) {
114114 const R0_IMAGE_VERSION_ID = "20250807-136"
115-
116- R0Version := createBuildInfoConnection (R0_IMAGE_VERSION_ID )
117- AnotherVersion := createBuildInfoConnection ("BUILD_ID=20250101-001" )
115+ anotherVersionId := "20250101-001"
118116
119117 tests := []struct {
120118 name string
121- currentVersion remote. RemoteConn
119+ currentVersion string
122120 targetVersion string
123121 isPreservationSupported bool
124122 }{
125123 {
126124 name : "both versions are *not* R0" ,
127- currentVersion : AnotherVersion ,
125+ currentVersion : anotherVersionId ,
128126 targetVersion : "20250101-001" ,
129127 isPreservationSupported : true ,
130128 },
131129 {
132130 name : "current version is R0" ,
133- currentVersion : R0Version ,
131+ currentVersion : R0_IMAGE_VERSION_ID ,
134132 targetVersion : "20250101-001" ,
135133 isPreservationSupported : false ,
136134 },
137135 {
138136 name : "target version is R0" ,
139- currentVersion : AnotherVersion ,
137+ currentVersion : anotherVersionId ,
140138 targetVersion : R0_IMAGE_VERSION_ID ,
141139 isPreservationSupported : false ,
142140 },
143141 {
144142 name : "both versions are R0" ,
145- currentVersion : R0Version ,
143+ currentVersion : R0_IMAGE_VERSION_ID ,
146144 targetVersion : R0_IMAGE_VERSION_ID ,
147145 isPreservationSupported : false ,
148146 },
149147 }
150148
151149 for _ , tt := range tests {
152150 t .Run (tt .name , func (t * testing.T ) {
153- isPreservationSupported := IsUserPartitionPreservationSupported (tt .currentVersion , OSImageRelease { ID : tt .targetVersion } )
151+ isPreservationSupported := IsUserPartitionPreservationSupported (tt .currentVersion , tt .targetVersion )
154152 require .Equal (t , isPreservationSupported , tt .isPreservationSupported )
155153 })
156154 }
0 commit comments