diff --git a/roles/upload-logs-gcs/library/test_zuul_google_storage_upload.py b/roles/upload-logs-gcs/library/test_zuul_google_storage_upload.py index 582893f62..01fd71c7f 100644 --- a/roles/upload-logs-gcs/library/test_zuul_google_storage_upload.py +++ b/roles/upload-logs-gcs/library/test_zuul_google_storage_upload.py @@ -194,7 +194,7 @@ class TestFileList(testtools.TestCase): self.assertEqual(len(rows), 1) - self.assertEqual(rows[0].find('a').get('href'), 'logs/') + self.assertEqual(rows[0].find('a').get('href'), 'logs/index.html') self.assertEqual(rows[0].find('a').text, 'logs/') subdir_index = self.find_file( @@ -202,7 +202,7 @@ class TestFileList(testtools.TestCase): page = open(subdir_index.full_path).read() page = BeautifulSoup(page, 'html.parser') rows = page.find_all('tr')[1:] - self.assertEqual(rows[0].find('a').get('href'), '../') + self.assertEqual(rows[0].find('a').get('href'), '../index.html') self.assertEqual(rows[0].find('a').text, '../') # Test proper escaping of files with funny names @@ -247,17 +247,19 @@ class TestFileList(testtools.TestCase): self.assertEqual(len(rows), 3) - self.assertEqual(rows[0].find('a').get('href'), 'controller/') + self.assertEqual(rows[0].find('a').get('href'), + 'controller/index.html') self.assertEqual(rows[0].find('a').text, 'controller/') - self.assertEqual(rows[1].find('a').get('href'), 'zuul-info/') + self.assertEqual(rows[1].find('a').get('href'), + 'zuul-info/index.html') self.assertEqual(rows[1].find('a').text, 'zuul-info/') subdir_index = self.find_file(fl, 'controller/subdir/index.html') page = open(subdir_index.full_path).read() page = BeautifulSoup(page, 'html.parser') rows = page.find_all('tr')[1:] - self.assertEqual(rows[0].find('a').get('href'), '../') + self.assertEqual(rows[0].find('a').get('href'), '../index.html') self.assertEqual(rows[0].find('a').text, '../') # Test proper escaping of files with funny names @@ -304,20 +306,23 @@ class TestFileList(testtools.TestCase): self.assertEqual(len(rows), 4) - self.assertEqual(rows[0].find('a').get('href'), '../') + self.assertEqual(rows[0].find('a').get('href'), + '../index.html') self.assertEqual(rows[0].find('a').text, '../') - self.assertEqual(rows[1].find('a').get('href'), 'controller/') + self.assertEqual(rows[1].find('a').get('href'), + 'controller/index.html') self.assertEqual(rows[1].find('a').text, 'controller/') - self.assertEqual(rows[2].find('a').get('href'), 'zuul-info/') + self.assertEqual(rows[2].find('a').get('href'), + 'zuul-info/index.html') self.assertEqual(rows[2].find('a').text, 'zuul-info/') subdir_index = self.find_file(fl, 'controller/subdir/index.html') page = open(subdir_index.full_path).read() page = BeautifulSoup(page, 'html.parser') rows = page.find_all('tr')[1:] - self.assertEqual(rows[0].find('a').get('href'), '../') + self.assertEqual(rows[0].find('a').get('href'), '../index.html') self.assertEqual(rows[0].find('a').text, '../') # Test proper escaping of files with funny names @@ -364,11 +369,15 @@ class TestFileList(testtools.TestCase): self.assertEqual(len(rows), 3) - self.assertEqual(rows[0].find('a').get('href'), 'controller/') - self.assertEqual(rows[0].find('a').text, 'controller/') + self.assertEqual(rows[0].find('a').get('href'), + 'controller/index.html') + self.assertEqual(rows[0].find('a').text, + 'controller/') - self.assertEqual(rows[1].find('a').get('href'), 'zuul-info/') - self.assertEqual(rows[1].find('a').text, 'zuul-info/') + self.assertEqual(rows[1].find('a').get('href'), + 'zuul-info/index.html') + self.assertEqual(rows[1].find('a').text, + 'zuul-info/') subdir_index = self.find_file(fl, 'controller/subdir/index.html') page = open(subdir_index.full_path).read() diff --git a/roles/upload-logs-gcs/library/zuul_google_storage_upload.py b/roles/upload-logs-gcs/library/zuul_google_storage_upload.py index e5a21434c..774a786df 100755 --- a/roles/upload-logs-gcs/library/zuul_google_storage_upload.py +++ b/roles/upload-logs-gcs/library/zuul_google_storage_upload.py @@ -465,10 +465,12 @@ class Indexer(): file_details.filename), })) filename = file_details.filename + link_filename = filename if file_details.folder: filename += '/' + link_filename += '/index.html' output += '