Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: appengine/swarming/local_smoke_test.py

Issue 2877483004: Reland "named caches: move instead of symlinking" (Closed)
Patch Set: remove wrong comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The LUCI Authors. All rights reserved. 2 # Copyright 2014 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 """Integration test for the Swarming server, Swarming bot and Swarming client. 6 """Integration test for the Swarming server, Swarming bot and Swarming client.
7 7
8 It starts both a Swarming server and a Swarming bot and triggers tasks with the 8 It starts both a Swarming server and a Swarming bot and triggers tasks with the
9 Swarming client to ensure the system works end to end. 9 Swarming client to ensure the system works end to end.
10 """ 10 """
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 ['--secret-bytes-path', tmp, '--', '${ISOLATED_OUTDIR}'], 631 ['--secret-bytes-path', tmp, '--', '${ISOLATED_OUTDIR}'],
632 expected_summary, {os.path.join('0', 'sekret'): 'foobar\n'}) 632 expected_summary, {os.path.join('0', 'sekret'): 'foobar\n'})
633 finally: 633 finally:
634 os.remove(tmp) 634 os.remove(tmp)
635 635
636 def test_local_cache(self): 636 def test_local_cache(self):
637 # First task creates the cache, second copy the content to the output 637 # First task creates the cache, second copy the content to the output
638 # directory. Each time it's the exact same script. 638 # directory. Each time it's the exact same script.
639 script = '\n'.join(( 639 script = '\n'.join((
640 'import os, shutil, sys', 640 'import os, shutil, sys',
641 'if not os.path.islink("p/b"):',
642 ' print("p/b is not a symlink")',
643 ' sys.exit(1)',
644 'p = "p/b/a.txt"', 641 'p = "p/b/a.txt"',
645 'if not os.path.isfile(p):', 642 'if not os.path.isfile(p):',
646 ' with open(p, "wb") as f:', 643 ' with open(p, "wb") as f:',
647 ' f.write("Yo!")', 644 ' f.write("Yo!")',
648 'else:', 645 'else:',
649 ' shutil.copy(p, sys.argv[1])', 646 ' shutil.copy(p, sys.argv[1])',
650 'print "hi"')) 647 'print "hi"'))
651 sizes = sorted([len(script), 200]) 648 sizes = sorted([len(script), 200])
652 expected_summary = self.gen_expected( 649 expected_summary = self.gen_expected(
653 name=u'cache_first', 650 name=u'cache_first',
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 if bot is not None and bot.poll() is None: 870 if bot is not None and bot.poll() is None:
874 bot.kill() 871 bot.kill()
875 bot.wait() 872 bot.wait()
876 finally: 873 finally:
877 cleanup(bot, client, servers, failed or verbose, leak) 874 cleanup(bot, client, servers, failed or verbose, leak)
878 return int(failed) 875 return int(failed)
879 876
880 877
881 if __name__ == '__main__': 878 if __name__ == '__main__':
882 sys.exit(main()) 879 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698