コード例 #1
0
ファイル: roots_test.py プロジェクト: yeyuexia/salt
    def test_dir_list(self):
        empty_dir = os.path.join(integration.TMP_STATE_TREE, 'empty_dir')
        if integration.TMP_STATE_TREE not in self.master_opts['file_roots'][
                'base']:
            self.skipTest(
                'This test fails when using tests/runtests.py. salt-runtests will be available soon.'
            )

        empty_dir = os.path.join(integration.TMP_STATE_TREE, 'empty_dir')
        if not os.path.isdir(empty_dir):
            # There's no use creating the empty-directory ourselves at this
            # point, the minions have already synced, it wouldn't get pushed to
            # them
            self.skipTest(
                'This test fails when using tests/runtests.py. salt-runtests will be available soon.'
            )

        with patch.dict(
                roots.__opts__, {
                    'cachedir': self.master_opts['cachedir'],
                    'file_roots': self.master_opts['file_roots'],
                    'fileserver_ignoresymlinks': False,
                    'fileserver_followsymlinks': False,
                    'file_ignore_regex': False,
                    'file_ignore_glob': False
                }):
            ret = roots.dir_list({'saltenv': 'base'})
            self.assertIn('empty_dir', ret)
コード例 #2
0
ファイル: test_roots.py プロジェクト: paususe/salt-saltstack
 def test_dir_list(self):
     empty_dir = self.tmp_state_tree / "empty_dir"
     if not empty_dir.is_dir():
         empty_dir.mkdir()
     self.addCleanup(salt.utils.files.rm_rf, str(empty_dir))
     ret = roots.dir_list({"saltenv": "base"})
     self.assertIn("empty_dir", ret)
     self.assertIn(UNICODE_DIRNAME, ret)
コード例 #3
0
ファイル: roots_test.py プロジェクト: Anbcorp/salt
 def test_dir_list(self):
     with patch.dict(roots.__opts__, {'file_roots': self.master_opts['file_roots'],
                              'fileserver_ignoresymlinks': False,
                              'fileserver_followsymlinks': False,
                              'file_ignore_regex': False,
                              'file_ignore_glob': False}):
         ret = roots.dir_list({'saltenv': 'base'})
         self.assertIn('empty_dir', ret)
コード例 #4
0
ファイル: roots_test.py プロジェクト: tligda/salt
 def test_dir_list(self):
     with patch.dict(
             roots.__opts__, {
                 'file_roots': self.master_opts['file_roots'],
                 'fileserver_ignoresymlinks': False,
                 'fileserver_followsymlinks': False,
                 'file_ignore_regex': False,
                 'file_ignore_glob': False
             }):
         ret = roots.dir_list({'saltenv': 'base'})
         self.assertIn('empty_dir', ret)
コード例 #5
0
ファイル: roots_test.py プロジェクト: AccelerationNet/salt
 def test_dir_list(self):
     with patch.dict(
         roots.__opts__,
         {
             "file_roots": self.master_opts["file_roots"],
             "fileserver_ignoresymlinks": False,
             "fileserver_followsymlinks": False,
             "file_ignore_regex": False,
             "file_ignore_glob": False,
         },
     ):
         ret = roots.dir_list({"saltenv": "base"})
         self.assertIn("empty_dir", ret)
コード例 #6
0
ファイル: roots_test.py プロジェクト: scentoni/salt
 def test_dir_list(self):
     if integration.TMP_STATE_TREE not in self.master_opts['file_roots'][
             'base']:
         self.skipTest(
             'This test fails when using tests/runtests.py. salt-runtests will be available soon.'
         )
     with patch.dict(
             roots.__opts__, {
                 'cachedir': self.master_opts['cachedir'],
                 'file_roots': self.master_opts['file_roots'],
                 'fileserver_ignoresymlinks': False,
                 'fileserver_followsymlinks': False,
                 'file_ignore_regex': False,
                 'file_ignore_glob': False
             }):
         ret = roots.dir_list({'saltenv': 'base'})
         self.assertIn('empty_dir', ret)
コード例 #7
0
ファイル: roots_test.py プロジェクト: bryson/salt
    def test_dir_list(self):
        empty_dir = os.path.join(integration.TMP_STATE_TREE, 'empty_dir')
        if integration.TMP_STATE_TREE not in self.master_opts['file_roots']['base']:
            self.skipTest('This test fails when using tests/runtests.py. salt-runtests will be available soon.')

        empty_dir = os.path.join(integration.TMP_STATE_TREE, 'empty_dir')
        if not os.path.isdir(empty_dir):
            # There's no use creating the empty-directory ourselves at this
            # point, the minions have already synced, it wouldn't get pushed to
            # them
            self.skipTest('This test fails when using tests/runtests.py. salt-runtests will be available soon.')

        with patch.dict(roots.__opts__, {'cachedir': self.master_opts['cachedir'],
                                         'file_roots': self.master_opts['file_roots'],
                                         'fileserver_ignoresymlinks': False,
                                         'fileserver_followsymlinks': False,
                                         'file_ignore_regex': False,
                                         'file_ignore_glob': False}):
            ret = roots.dir_list({'saltenv': 'base'})
            self.assertIn('empty_dir', ret)
コード例 #8
0
ファイル: test_roots.py プロジェクト: elisapa/salt-1
 def test_dir_list(self):
     ret = roots.dir_list({'saltenv': 'base'})
     self.assertIn('empty_dir', ret)
     self.assertIn(UNICODE_DIRNAME, ret)
コード例 #9
0
ファイル: test_roots.py プロジェクト: yambehis/salt
 def test_dir_list(self):
     ret = roots.dir_list({"saltenv": "base"})
     self.assertIn("empty_dir", ret)
     self.assertIn(UNICODE_DIRNAME, ret)