<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> import os <EOL> import yaml <EOL> import signal <EOL> import shutil <EOL> from salttesting . helpers import ensure_in_syspath <EOL> ensure_in_syspath ( '<STR_LIT>' ) <EOL> import integration <EOL> import salt . utils <EOL> class SyndicTest ( integration . ShellCase , integration . ShellCaseCommonTestsMixIn ) : <EOL> _call_binary_ = '<STR_LIT>' <EOL> def test_issue_7754 ( self ) : <EOL> old_cwd = os . getcwd ( ) <EOL> config_dir = os . path . join ( integration . TMP , '<STR_LIT>' ) <EOL> if not os . path . isdir ( config_dir ) : <EOL> os . makedirs ( config_dir ) <EOL> os . chdir ( config_dir ) <EOL> for fname in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> pid_path = os . path . join ( config_dir , '<STR_LIT>' . format ( fname ) ) <EOL> with salt . utils . fopen ( self . get_config_file_path ( fname ) , '<STR_LIT:r>' ) as fhr : <EOL> config = yaml . load ( fhr . read ( ) ) <EOL> config [ '<STR_LIT>' ] = config [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> config [ '<STR_LIT>' ] = config_dir <EOL> if '<STR_LIT>' in config : <EOL> config [ '<STR_LIT>' ] = int ( config [ '<STR_LIT>' ] ) + <NUM_LIT:10> <EOL> config [ '<STR_LIT>' ] = int ( config [ '<STR_LIT>' ] ) + <NUM_LIT:10> <EOL> with salt . utils . fopen ( os . path . join ( config_dir , fname ) , '<STR_LIT:w>' ) as fhw : <EOL> fhw . write ( <EOL> yaml . dump ( config , default_flow_style = False ) <EOL> ) <EOL> ret = self . run_script ( <EOL> self . _call_binary_ , <EOL> '<STR_LIT>' . format ( <EOL> config_dir , <EOL> pid_path <EOL> ) , <EOL> timeout = <NUM_LIT:5> , <EOL> catch_stderr = True , <EOL> with_retcode = True <EOL> ) <EOL> if os . path . exists ( pid_path ) : <EOL> with salt . utils . fopen ( pid_path ) as fhr : <EOL> try : <EOL> os . kill ( int ( fhr . read ( ) ) , signal . SIGKILL ) <EOL> except OSError : <EOL> pass <EOL> try : <EOL> self . assertFalse ( os . path . isdir ( os . path . join ( config_dir , '<STR_LIT>' ) ) ) <EOL> self . assertIn ( <EOL> '<STR_LIT>' , '<STR_LIT:\n>' . join ( ret [ <NUM_LIT:1> ] ) <EOL> ) <EOL> self . assertEqual ( ret [ <NUM_LIT:2> ] , <NUM_LIT:2> ) <EOL> finally : <EOL> self . chdir ( old_cwd ) <EOL> if os . path . isdir ( config_dir ) : <EOL> shutil . rmtree ( config_dir ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( SyndicTest ) </s>
