@Override
  public void beforeTest(QTestUtil qt) throws Exception {
    if (enabled) {
      String schemaVersion = MetaStoreSchemaInfoFactory.get(qt.getConf()).getHiveSchemaVersion();
      String stsdbPath =
          HiveTestEnvSetup.HIVE_ROOT + "/standalone-metastore/metastore-server/src/main/sql/hive/hive-schema-" + schemaVersion + ".hive.sql";
      qt.getCliDriver().processLine("source " + stsdbPath);
      qt.getCliDriver().processLine("use default");
    }
  }
QTest sysdb directive handler

Loads the sysdb schema prior to running the test.

Example:
--! qt:sysdb
itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestSysDbHandler.java