@@ -703,6 +703,42 @@ def test_adhoc_1so_preplaybook(self):
703703 except OSError :
704704 pass
705705
706+ def test_adhoc_1so_splunk_launch_conf (self ):
707+ # Create a splunk container
708+ cid = None
709+ try :
710+ splunk_container_name = generate_random_string ()
711+ cid = self .client .create_container (self .SPLUNK_IMAGE_NAME , tty = True , ports = [8089 ], name = splunk_container_name ,
712+ environment = {
713+ "DEBUG" : "true" ,
714+ "SPLUNK_START_ARGS" : "--accept-license" ,
715+ "SPLUNK_PASSWORD" : self .password ,
716+ "SPLUNK_LAUNCH_CONF" : "OPTIMISTIC_ABOUT_FILE_LOCKING=1,HELLO=WORLD"
717+ },
718+ host_config = self .client .create_host_config (port_bindings = {8089 : ("0.0.0.0" ,)})
719+ )
720+ cid = cid .get ("Id" )
721+ self .client .start (cid )
722+ # Poll for the container to be ready
723+ assert self .wait_for_containers (1 , name = splunk_container_name )
724+ # Check splunkd
725+ splunkd_port = self .client .port (cid , 8089 )[0 ]["HostPort" ]
726+ url = "https://localhost:{}/services/server/info" .format (splunkd_port )
727+ kwargs = {"auth" : ("admin" , self .password ), "verify" : False }
728+ status , content = self .handle_request_retry ("GET" , url , kwargs )
729+ assert status == 200
730+ # Check splunk-launch.conf
731+ exec_command = self .client .exec_create (cid , r'cat /opt/splunk/etc/splunk-launch.conf' , user = "splunk" )
732+ std_out = self .client .exec_start (exec_command )
733+ assert "OPTIMISTIC_ABOUT_FILE_LOCKING=1" in std_out
734+ assert "HELLO=WORLD" in std_out
735+ except Exception as e :
736+ self .logger .error (e )
737+ raise e
738+ finally :
739+ if cid :
740+ self .client .remove_container (cid , v = True , force = True )
741+
706742 def test_adhoc_1so_change_tailed_files (self ):
707743 # Create a splunk container
708744 cid = None
0 commit comments