summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2013-11-25 15:20:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-25 16:14:48 +0000
commit447a057988eea8335e13439d35afb82a939264e1 (patch)
tree4e1f36ea4a51ca89fabb630eadb5bf324133474c /meta
parent181875b5d9e5e4826557c2e44cf37e47d14e5e63 (diff)
downloadpoky-447a057988eea8335e13439d35afb82a939264e1.tar.gz
sanity: Use random filename for maximum path length test
check_create_long_filename used a fixed filename for its test files. This meant that os.remove(testfile) could fail with ENOENT if two instances were running at the same time against the same sstate directory. Using a randomly generated filename stops this from happening. (Although it might seem unlikely, this race did appear to occur multiple times with Jenkins - presumably because the matrix jobs were all kicked off at the same time.) (From OE-Core rev: bc28e3f26e7f85af82f403924c0ae29e1ad34a87) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sanity.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index b26ea6b372..8531df16b0 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -175,7 +175,8 @@ def check_conf_exists(fn, data):
175 return False 175 return False
176 176
177def check_create_long_filename(filepath, pathname): 177def check_create_long_filename(filepath, pathname):
178 testfile = os.path.join(filepath, ''.join([`num`[-1] for num in xrange(1,200)])) 178 import string, random
179 testfile = os.path.join(filepath, ''.join(random.choice(string.ascii_letters) for x in range(200)))
179 try: 180 try:
180 if not os.path.exists(filepath): 181 if not os.path.exists(filepath):
181 bb.utils.mkdirhier(filepath) 182 bb.utils.mkdirhier(filepath)