File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
src/Tests/dotnet-MsiInstallation.Tests Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ string SdkInstallerVersion
74
74
}
75
75
""" ;
76
76
77
- //VMControl VM { get; }
78
77
VirtualMachine VM { get ; }
79
78
80
79
public WorkloadTests ( ITestOutputHelper log ) : base ( log )
@@ -171,7 +170,19 @@ public void InstallAndroidAndWasm()
171
170
[ Fact ]
172
171
public void SdkInstallation ( )
173
172
{
174
- GetInstalledSdkVersion ( ) . Should ( ) . Be ( "7.0.401" ) ;
173
+ var command = VM . CreateRunCommand ( "dotnet" , "--version" ) ;
174
+ command . IsReadOnly = true ;
175
+
176
+ string originalSdkVersion ;
177
+ var versionResult = command . Execute ( ) ;
178
+ if ( versionResult . ExitCode == 0 )
179
+ {
180
+ originalSdkVersion = versionResult . StdOut ;
181
+ }
182
+ else
183
+ {
184
+ originalSdkVersion = null ;
185
+ }
175
186
176
187
InstallSdk ( deployStage2 : false ) ;
177
188
@@ -187,7 +198,16 @@ public void SdkInstallation()
187
198
. Should ( )
188
199
. NotExist ( ) ;
189
200
190
- GetInstalledSdkVersion ( ) . Should ( ) . Be ( "7.0.401" ) ;
201
+ if ( originalSdkVersion != null )
202
+ {
203
+ GetInstalledSdkVersion ( ) . Should ( ) . Be ( originalSdkVersion ) ;
204
+ }
205
+ else
206
+ {
207
+ VM . GetRemoteDirectory ( $@ "c:\Program Files\dotnet")
208
+ . Should ( )
209
+ . NotExist ( ) ;
210
+ }
191
211
}
192
212
193
213
You can’t perform that action at this time.
0 commit comments