test cloning with our test app
This commit is contained in:
parent
512e9d682b
commit
3c4103032d
|
@ -71,16 +71,16 @@ describe('Application flow test', function () {
|
||||||
cloudron.checkAddons(cloudron.appFqdn(location), owner);
|
cloudron.checkAddons(cloudron.appFqdn(location), owner);
|
||||||
});
|
});
|
||||||
|
|
||||||
function checkExposedPort(done) {
|
function checkExposedPort(port, done) {
|
||||||
var client = new net.Socket();
|
var client = new net.Socket();
|
||||||
var data = [ ];
|
var data = [ ];
|
||||||
client.connect(5151, cloudron.appFqdn(location), function() {
|
client.connect(port, cloudron.appFqdn(location), function() {
|
||||||
console.log('connected to 5151');
|
console.log('connected to ' + port);
|
||||||
});
|
});
|
||||||
client.on('data', function (chunk) { data.push(chunk); });
|
client.on('data', function (chunk) { data.push(chunk); });
|
||||||
client.on('close', function () {
|
client.on('close', function () {
|
||||||
var response = Buffer.concat(data).toString('utf8');
|
var response = Buffer.concat(data).toString('utf8');
|
||||||
if (response === 'ECHO_SERVER_PORT=5151') return done();
|
if (response === 'ECHO_SERVER_PORT=' + port) return done();
|
||||||
console.log('unexpected response:', response);
|
console.log('unexpected response:', response);
|
||||||
done(new Error('bad response'));
|
done(new Error('bad response'));
|
||||||
});
|
});
|
||||||
|
@ -88,7 +88,7 @@ describe('Application flow test', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
it('can access exposed port', function (done) {
|
it('can access exposed port', function (done) {
|
||||||
checkExposedPort(done);
|
checkExposedPort(5151, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('displays app graphs', function () {
|
it('displays app graphs', function () {
|
||||||
|
@ -105,7 +105,7 @@ describe('Application flow test', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can access exposed port', function (done) {
|
it('can access exposed port', function (done) {
|
||||||
checkExposedPort(done);
|
checkExposedPort(5151, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can reboot the cloudron', function () {
|
it('can reboot the cloudron', function () {
|
||||||
|
@ -117,7 +117,21 @@ describe('Application flow test', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can access exposed port', function (done) {
|
it('can access exposed port', function (done) {
|
||||||
checkExposedPort(done);
|
checkExposedPort(5151, done);
|
||||||
|
});
|
||||||
|
|
||||||
|
var cloneLocation;
|
||||||
|
it('can clone app', function () {
|
||||||
|
cloneLocation = location + 'clone';
|
||||||
|
cloudron.cloneApp(appId, location + 'clone', { ECHO_SERVER_PORT: 5252 });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can check the addons', function () {
|
||||||
|
cloudron.checkAddons(cloudron.appFqdn(cloneLocation), owner);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can access exposed port', function (done) {
|
||||||
|
checkExposedPort(5252, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can uninstall app', function () {
|
it('can uninstall app', function () {
|
||||||
|
|
Loading…
Reference in New Issue