File tree Expand file tree Collapse file tree
src/Testcontainers/Clients
tests/Testcontainers.Tests/Unit/Containers/Unix Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ public void Report(JSONMessage value)
3737 _logger . LogError ( value . ErrorMessage . TrimEnd ( ) ) ;
3838 }
3939
40+ if ( value . Error != null )
41+ {
42+ throw new Exception ( value . Error . Message ) ;
43+ }
44+
4045#pragma warning restore CA1848 , CA2254
4146 }
4247 }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ namespace DotNet.Testcontainers.Tests.Unit
55 using System . IO ;
66 using System . Net ;
77 using System . Net . Sockets ;
8+ using System . Runtime . InteropServices ;
89 using System . Text ;
910 using System . Threading . Tasks ;
1011 using DotNet . Testcontainers . Builders ;
@@ -539,6 +540,21 @@ public async Task PullPolicyNever()
539540 await Assert . ThrowsAnyAsync < Exception > ( ( ) => container . StartAsync ( TestContext . Current . CancellationToken ) )
540541 . ConfigureAwait ( true ) ;
541542 }
543+
544+ [ Fact ]
545+ public async Task NoMatchingManifest ( )
546+ {
547+ Assert . SkipWhen ( RuntimeInformation . ProcessArchitecture == Architecture . X64 , "Only relevant on non x64 architectures" ) ;
548+
549+ await using var container = new ContainerBuilder ( "alpine:3.1" )
550+ . WithEntrypoint ( CommonCommands . SleepInfinity )
551+ . WithImagePullPolicy ( PullPolicy . Always )
552+ . Build ( ) ;
553+
554+ var exception = await Assert . ThrowsAnyAsync < Exception > ( ( ) => container . StartAsync ( TestContext . Current . CancellationToken ) )
555+ . ConfigureAwait ( true ) ;
556+ Assert . Contains ( "no matching manifest" , exception . Message ) ;
557+ }
542558 }
543559 }
544560}
You can’t perform that action at this time.
0 commit comments