@@ -441,7 +441,7 @@ mod tests {
441441 ) ,
442442 ] ) ;
443443
444- let image = GenericImage :: new ( "hello-world " , "latest " ) . with_labels ( & labels) ;
444+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) . with_labels ( & labels) ;
445445
446446 let container = {
447447 #[ cfg( not( feature = "reusable-containers" ) ) ]
@@ -494,7 +494,9 @@ mod tests {
494494 async fn async_run_command_should_expose_all_ports_if_no_explicit_mapping_requested (
495495 ) -> anyhow:: Result < ( ) > {
496496 let client = Client :: lazy_client ( ) . await ?;
497- let container = GenericImage :: new ( "hello-world" , "latest" ) . start ( ) . await ?;
497+ let container = GenericImage :: new ( "testcontainers/helloworld" , "1.3.0" )
498+ . start ( )
499+ . await ?;
498500
499501 let container_details = client. inspect ( container. id ( ) ) . await ?;
500502 let publish_ports = container_details
@@ -588,18 +590,16 @@ mod tests {
588590 let client = Client :: lazy_client ( ) . await ?;
589591 let _ = pretty_env_logger:: try_init ( ) ;
590592
591- let udp_port = 1000 ;
592- let sctp_port = 2000 ;
593+ let udp_port = 1000 . udp ( ) ;
594+ let sctp_port = 2000 . sctp ( ) ;
593595
594596 let generic_server = get_server_container ( )
595597 . await
596598 // Explicitly expose the port, which otherwise would not be available.
597- . with_exposed_port ( udp_port. udp ( ) )
598- . with_exposed_port ( sctp_port. sctp ( ) ) ;
599+ . with_exposed_port ( udp_port)
600+ . with_exposed_port ( sctp_port) ;
599601
600602 let container = generic_server. start ( ) . await ?;
601- container. get_host_port_ipv4 ( udp_port. udp ( ) ) . await ?;
602- container. get_host_port_ipv4 ( sctp_port. sctp ( ) ) . await ?;
603603
604604 let container_details = client. inspect ( container. id ( ) ) . await ?;
605605
@@ -623,15 +623,20 @@ mod tests {
623623 expected_ports. push ( sctp_expected_port) ;
624624 expected_ports. push ( tcp_expected_port) ;
625625
626- assert_eq ! ( current_ports, expected_ports) ;
626+ assert ! (
627+ expected_ports
628+ . iter( )
629+ . all( |port| current_ports. contains( port) ) ,
630+ "exposed ports: {current_ports:?} doesn't contain all expected ports: {expected_ports:?}"
631+ ) ;
627632
628633 Ok ( ( ) )
629634 }
630635
631636 #[ tokio:: test]
632637 async fn async_run_command_should_expose_only_requested_ports ( ) -> anyhow:: Result < ( ) > {
633638 let client = Client :: lazy_client ( ) . await ?;
634- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
639+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
635640 let container = image
636641 . with_mapped_port ( 123 , 456 . tcp ( ) )
637642 . with_mapped_port ( 555 , 888 . tcp ( ) )
@@ -665,7 +670,7 @@ mod tests {
665670 let udp_port = 1000 ;
666671 let sctp_port = 2000 ;
667672
668- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
673+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
669674 let container = image
670675 . with_mapped_port ( 123 , udp_port. udp ( ) )
671676 . with_mapped_port ( 555 , sctp_port. sctp ( ) )
@@ -700,7 +705,7 @@ mod tests {
700705 #[ tokio:: test]
701706 async fn async_run_command_should_include_network ( ) -> anyhow:: Result < ( ) > {
702707 let client = Client :: lazy_client ( ) . await ?;
703- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
708+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
704709 let container = image. with_network ( "awesome-net-1" ) . start ( ) . await ?;
705710
706711 let container_details = client. inspect ( container. id ( ) ) . await ?;
@@ -720,7 +725,7 @@ mod tests {
720725 #[ tokio:: test]
721726 async fn async_run_command_should_include_name ( ) -> anyhow:: Result < ( ) > {
722727 let client = Client :: lazy_client ( ) . await ?;
723- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
728+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
724729 let container = image
725730 . with_container_name ( "async_hello_container" )
726731 . start ( )
@@ -735,7 +740,7 @@ mod tests {
735740 #[ tokio:: test]
736741 async fn async_should_create_network_if_image_needs_it_and_drop_it_in_the_end (
737742 ) -> anyhow:: Result < ( ) > {
738- let hello_world = GenericImage :: new ( "hello-world " , "latest " ) ;
743+ let hello_world = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
739744
740745 {
741746 let client = Client :: lazy_client ( ) . await ?;
@@ -800,7 +805,7 @@ mod tests {
800805 #[ tokio:: test]
801806 async fn async_run_command_should_set_shared_memory_size ( ) -> anyhow:: Result < ( ) > {
802807 let client = Client :: lazy_client ( ) . await ?;
803- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
808+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
804809 let container = image. with_shm_size ( 1_000_000 ) . start ( ) . await ?;
805810
806811 let container_details = client. inspect ( container. id ( ) ) . await ?;
@@ -816,7 +821,7 @@ mod tests {
816821
817822 #[ tokio:: test]
818823 async fn async_run_command_should_include_privileged ( ) -> anyhow:: Result < ( ) > {
819- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
824+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
820825 let container = image. with_privileged ( true ) . start ( ) . await ?;
821826
822827 let client = Client :: lazy_client ( ) . await ?;
@@ -833,7 +838,7 @@ mod tests {
833838
834839 #[ tokio:: test]
835840 async fn async_run_command_should_have_cap_add ( ) -> anyhow:: Result < ( ) > {
836- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
841+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
837842 let expected_capability = "NET_ADMIN" ;
838843 let container = image
839844 . with_cap_add ( expected_capability. to_string ( ) )
@@ -860,7 +865,7 @@ mod tests {
860865
861866 #[ tokio:: test]
862867 async fn async_run_command_should_have_cap_drop ( ) -> anyhow:: Result < ( ) > {
863- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
868+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
864869 let expected_capability = "AUDIT_WRITE" ;
865870 let container = image
866871 . with_cap_drop ( expected_capability. to_string ( ) )
@@ -887,7 +892,7 @@ mod tests {
887892
888893 #[ tokio:: test]
889894 async fn async_run_command_should_include_ulimits ( ) -> anyhow:: Result < ( ) > {
890- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
895+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
891896 let container = image. with_ulimit ( "nofile" , 123 , Some ( 456 ) ) . start ( ) . await ?;
892897
893898 let client = Client :: lazy_client ( ) . await ?;
@@ -908,7 +913,7 @@ mod tests {
908913
909914 #[ tokio:: test]
910915 async fn async_run_command_should_have_host_cgroupns_mode ( ) -> anyhow:: Result < ( ) > {
911- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
916+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
912917 let container = image. with_cgroupns_mode ( CgroupnsMode :: Host ) . start ( ) . await ?;
913918
914919 let client = Client :: lazy_client ( ) . await ?;
@@ -930,7 +935,7 @@ mod tests {
930935
931936 #[ tokio:: test]
932937 async fn async_run_command_should_have_private_cgroupns_mode ( ) -> anyhow:: Result < ( ) > {
933- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
938+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
934939 let container = image
935940 . with_cgroupns_mode ( CgroupnsMode :: Private )
936941 . start ( )
@@ -955,7 +960,7 @@ mod tests {
955960
956961 #[ tokio:: test]
957962 async fn async_run_command_should_have_host_userns_mode ( ) -> anyhow:: Result < ( ) > {
958- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
963+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.3.0 " ) ;
959964 let container = image. with_userns_mode ( "host" ) . start ( ) . await ?;
960965
961966 let client = Client :: lazy_client ( ) . await ?;
@@ -972,7 +977,7 @@ mod tests {
972977
973978 #[ tokio:: test]
974979 async fn async_run_command_should_have_working_dir ( ) -> anyhow:: Result < ( ) > {
975- let image = GenericImage :: new ( "hello-world " , "latest " ) ;
980+ let image = GenericImage :: new ( "testcontainers/helloworld " , "1.2.0 " ) ;
976981 let expected_working_dir = "/foo" ;
977982 let container = image. with_working_dir ( expected_working_dir) . start ( ) . await ?;
978983
0 commit comments