Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions tests/gold_tests/pluginTest/slice/gold/slice_prefetch.gold

This file was deleted.

33 changes: 32 additions & 1 deletion tests/gold_tests/pluginTest/slice/slice_prefetch.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import re

Test.Summary = '''
slice plugin prefetch feature test
Expand Down Expand Up @@ -180,4 +181,34 @@
cache_file,
r'\*/18 hit-fresh, none$',
)
ts.Disk.File(cache_file).Content = "gold/slice_prefetch.gold"
cache_log = ts.Disk.File(cache_file)
expected_cache_entries = [
"bytes 0-6/18 miss",
"bytes 7-13/18 miss",
"bytes 14-17/18 miss",
"bytes 14-17/18 hit-fresh",
"- miss, none",
"bytes 0-6/18 hit-fresh",
"bytes 7-13/18 hit-fresh",
"bytes 14-17/18 hit-fresh",
"- hit-fresh, none",
"bytes 0-6/18 hit-stale",
"bytes 7-13/18 hit-stale",
"bytes 14-17/18 hit-stale",
"- hit-stale, none",
"bytes 0-17/18 hit-fresh, none",
"bytes 0-4/18 miss",
"bytes 5-9/18 miss",
"bytes 10-14/18 miss",
"bytes 15-17/18 miss",
"bytes 10-14/18 hit-fresh",
"bytes 15-17/18 hit-fresh",
"bytes 5-16/18 miss, none",
"*/18 hit-fresh, none",
]
for index, entry in enumerate(expected_cache_entries):
tester = Testers.ContainsExpression(f'(?m)^{re.escape(entry)}$', f'Verify cache log contains: {entry}')
if index == 0:
cache_log.Content = tester
else:
cache_log.Content += tester