}
};
-static void _fsync_name( std::string n )
+static void _fsync_name( const std::string &n )
{
int fd = open( n.c_str(), O_WRONLY );
if ( fd >= 0 ) {
Options opt;
const char *env;
- if ( args.has( "--help" ) ) {
+ if ( args.has( "--help" ) || args.has( "-h" ) || args.has( "-?" ) ) {
std::cout <<
" lvm2-testsuite - Run a lvm2 testsuite.\n\n"
"lvm2-testsuite"
opt.workdir = resolve_path( args.opt( "--workdir" ), opt.testdir.c_str() );
opt.outdir = resolve_path( args.opt( "--outdir" ), "." );
+ if (getuid() != 0) {
+ std::cout << "Skipping tests, root is required, current UID: " << getuid() << "\n";
+ return 0;
+ }
+
setup_handlers();
Main main( opt );
int main(int argc, const char **argv)
{
-
- if (getuid() != 0) {
- std::cout << "Skipping tests, root is required, current UID: " << getuid() << "\n";
- return 0;
- }
-
try {
return brick::shelltest::run( argc, argv, "LVM_TEST_FLAVOUR" );
} catch (std::exception const& e) {