Example #1
0
 writeLoginData: function (options) {
   fs.writeFileSync(
     path.resolve(options.xt.coredir, 'test/lib/login_data.js'),
     lib.util.wrapModule({
       data: {
         webaddress: 'https://' + options.nginx.hostname + ':' + options.nginx.httpsport,
         username: '******',
         pwd: options.xt.adminpw,
         org: options.xt.testdb
       }
     }));
 },
Example #2
0
  executeTask: function (options) {
    var res = lib.pgCli.psql(options, [

      'select pg_terminate_backend(pg_stat_activity.pid)',
      'from pg_stat_activity where pg_stat_activity.datname = \'' + options.pg.dbname + '\'',
      'and pid <> pg_backend_pid();',

      'alter database \"' + options.pg.dbname + '\" rename to ' + options.pg.newname

    ].join(' '));
    log.verbose('pg-rename', res);

    var configObject = require(options.xt.configfile);
    res = _.pull(configObject.datasource.databases, options.pg.dbname);
    configObject.datasource.databases.push(options.pg.newname);

    fs.writeFileSync(options.xt.configfile, lib.util.wrapModule(configObject));
  },