/**
* Test to make sure you can't add a config server as shard
*/
var st = new ShardingTest({ shards: [{ useHostName: true }],
other: {
shardOptions: {
smallfiles: "",
noprealloc: ""
}
}
});
var configConf = {
useHostname: "localhost",
noJournalPrealloc: true,
port: 29004,
pathOpts: { testName: "test", config: 4 },
dbpath: "$testName-config$config",
configsvr: ""
};
var newConfig = MongoRunner.runMongod(configConf);
print("Printing initial config server command line options:");
printjson(st.config0.getDB("admin").runCommand({"getCmdLineOpts": 1}));
print("Printing newConfig server command line options:");
printjson(newConfig.getDB("admin").runCommand({"getCmdLineOpts": 1}));
print("Printing current config servers");
printjson(st._configServers);
print("newConfig host:");
print(newConfig.host);
st.printShardingStatus();
res = st.s.adminCommand({addShard: newConfig.host });
assert.eq(res.ok, 0);
print("Printing config servers");
printjson(st._configServers);
st.printShardingStatus()
st.stop();