As of SERVER-27625, mongods started without an on-disk shardIdentity document will reject all sharding requests (until they receive a shardIdentity doc by being added to a cluster).
Any tests that restart a shard mongod and send sharding requests to it after restart cannot make the shard use an in-memory storage engine, since the shardIdentity document will be lost after restart.