tests: Factor "seq" shell function out into common infrastructure.