Browse Source

fixes to launch sage test

tags/v0.1.8
Jonathan Cobb 4 years ago
parent
commit
f2b772d66b
4 changed files with 83 additions and 28 deletions
  1. +10
    -3
      bubble-server/src/test/java/bubble/test/live/LaunchSageTest.java
  2. +2
    -2
      bubble-server/src/test/resources/models/include/add_approved_contact.json
  3. +48
    -10
      bubble-server/src/test/resources/models/include/fork.json
  4. +23
    -13
      bubble-server/src/test/resources/models/system/bubblePlan.json

+ 10
- 3
bubble-server/src/test/java/bubble/test/live/LaunchSageTest.java View File

@@ -1,14 +1,21 @@
package bubble.test.live; package bubble.test.live;


import bubble.cloud.CloudServiceDriver;
import bubble.cloud.dns.godaddy.GoDaddyDnsDriver;
import org.junit.Test; import org.junit.Test;


import static bubble.ApiConstants.getBubbleDefaultDomain;

public class LaunchSageTest extends LiveTestBase { public class LaunchSageTest extends LiveTestBase {


@Override protected String getManifest() { return "manifest-live"; }

@Override protected Class<? extends CloudServiceDriver> getPublicDnsDriver() { return GoDaddyDnsDriver.class; }

@Override protected String getTestSageFqdn() { return null; } @Override protected String getTestSageFqdn() { return null; }
@Override protected boolean shouldStopSage() { return false; } @Override protected boolean shouldStopSage() { return false; }
@Override public String getDefaultDomain() { return getBubbleDefaultDomain(); }


@Override protected String getManifest() { return "manifest-live"; }

@Test public void testLaunchSage () throws Exception {}
@Test public void testLaunchSage () {}


} }

+ 2
- 2
bubble-server/src/test/resources/models/include/add_approved_contact.json View File

@@ -21,7 +21,7 @@
"connection": {"name": "<<userConnection>>"}, "connection": {"name": "<<userConnection>>"},
"request": { "request": {
"session": "<<userSession>>", "session": "<<userSession>>",
"uri": "users/<<username>>/policy/contacts/<<contactType>>/<<contactInfo>>"
"uri": "users/<<username>>/policy/contacts/<<contactType>>/<<urlEncode contactInfo>>"
}, },
"response": { "response": {
"store": "existingContact", "store": "existingContact",
@@ -71,7 +71,7 @@
"connection": {"name": "<<rootConnection>>"}, "connection": {"name": "<<rootConnection>>"},
"request": { "request": {
"session": "<<rootSession>>", "session": "<<rootSession>>",
"uri": "debug/inbox/<<contactType>>/<<contactLookup>>?type=request&action=verify&target=account"
"uri": "debug/inbox/<<contactType>>/<<urlEncode contactLookup>>?type=request&action=verify&target=account"
}, },
"response": { "response": {
"store": "<<contactType>>Inbox", "store": "<<contactType>>Inbox",


+ 48
- 10
bubble-server/src/test/resources/models/include/fork.json View File

@@ -5,15 +5,13 @@
"params": { "params": {
"rootUsername": "root", "rootUsername": "root",
"rootPassword": "password", "rootPassword": "password",
"username": "user-<<rand 5>>",
"password": "<<rand 10>>",
"email": "user-<<rand 5>>@example.com", "email": "user-<<rand 5>>@example.com",
"planVar": "plan", "planVar": "plan",
"hostname": "api-<<rand 5>>",
"forkHost": "api-<<rand 5>>",
"network": "_required", "network": "_required",
"domain": "{{defaultDomain}}", "domain": "{{defaultDomain}}",
"locale": "en_US", "locale": "en_US",
"timezone": "EST",
"timezone": "America/New_York",
"plan": "bubble", "plan": "bubble",
"networkVar": "newNetwork", "networkVar": "newNetwork",
"networkConnectionVar": "newNetworkConnection", "networkConnectionVar": "newNetworkConnection",
@@ -23,6 +21,41 @@
} }
}, },


{
"comment": "add email contact for root user",
"include": "add_approved_contact",
"params": {
"username": "root",
"userSession": "rootSession",
"contactInfo": "<<email>>",
"contactLookup": "<<email>>"
}
},

{
"comment": "add an ssh key",
"request": {
"uri": "me/keys",
"method": "put",
"entity": {
"name": "root SSH key",
"sshPublicKey": "{{serverConfig.environment.TEST_SSH_KEY}}"
}
},
"response": {
"store": "sshKey"
}
},

{
"comment": "get payment methods, tokenize a credit card",
"request": { "uri": "paymentMethods" },
"response": {
"store": "paymentMethods"
},
"after": "stripe_tokenize_card"
},

{ {
"comment": "add plan", "comment": "add plan",
"request": { "request": {
@@ -34,7 +67,12 @@
"locale": "<<locale>>", "locale": "<<locale>>",
"timezone": "<<timezone>>", "timezone": "<<timezone>>",
"plan": "<<plan>>", "plan": "<<plan>>",
"footprint": "<<footprint>>"
"footprint": "<<footprint>>",
"sshKey": "{{sshKey.uuid}}",
"paymentMethodObject": {
"paymentMethodType": "credit",
"paymentInfo": "{{stripeToken}}"
}
} }
}, },
"response": { "response": {
@@ -45,7 +83,7 @@
{ {
"comment": "fork the system; sets up the first node, which does the rest", "comment": "fork the system; sets up the first node, which does the rest",
"request": { "request": {
"uri": "me/networks/<<network>>/actions/fork/<<hostname>>.<<network>>.<<domain>>?cloud=<<urlEncode compute>>&region=<<urlEncode region>>",
"uri": "me/networks/<<network>>/actions/fork/<<forkHost>>.<<network>>.<<domain>>?cloud=<<urlEncode compute>>&region=<<urlEncode region>>",
"method": "put" "method": "put"
}, },
"response": { "response": {
@@ -54,10 +92,10 @@
}, },


{ {
"before": "await_url me/networks/<<network>>/dns/find?type=A&name=<<hostname>>.<<network>>.<<domain>> 30m 10s await_json.length > 0",
"before": "await_url me/networks/<<network>>/dns/find?type=A&name=<<forkHost>>.<<network>>.<<domain>> 30m 10s await_json.length > 0",
"comment": "list DNS for the forked network, should now see a DNS A record for new instance", "comment": "list DNS for the forked network, should now see a DNS A record for new instance",
"request": { "request": {
"uri": "me/networks/<<network>>/dns/find?type=A&name=<<hostname>>.<<network>>.<<domain>>"
"uri": "me/networks/<<network>>/dns/find?type=A&name=<<forkHost>>.<<network>>.<<domain>>"
}, },
"response": { "response": {
"store": "dnsRecords", "store": "dnsRecords",
@@ -68,11 +106,11 @@
}, },


{ {
"before": "await_url https://<<hostname>>.<<network>>.<<domain>>:{{serverConfig.nginxPort}}/api/.bubble 40m 20s",
"before": "await_url https://<<forkHost>>.<<network>>.<<domain>>:{{serverConfig.nginxPort}}/api/.bubble 40m 20s",
"comment": "call API of deployed node, ensure it is running", "comment": "call API of deployed node, ensure it is running",
"connection": { "connection": {
"name": "<<networkConnectionVar>>", "name": "<<networkConnectionVar>>",
"baseUri": "https://<<hostname>>.<<network>>.<<domain>>:{{serverConfig.nginxPort}}/api"
"baseUri": "https://<<forkHost>>.<<network>>.<<domain>>:{{serverConfig.nginxPort}}/api"
}, },
"request": { "uri" : ".bubble" }, "request": { "uri" : ".bubble" },
"response": { "response": {


+ 23
- 13
bubble-server/src/test/resources/models/system/bubblePlan.json View File

@@ -1,16 +1,15 @@
[
{
"name": "bubble",
"chargeName": "BubbleStd",
"computeSizeType": "small",
"nodesIncluded": 1,
"additionalPerNodePrice": 1200,
"price": 1200,
"storageGbIncluded": 15,
"additionalStoragePerGbPrice": 2,
"bandwidthGbIncluded": 500,
"additionalBandwidthPerGbPrice": 2
}, {
[{
"name": "bubble",
"chargeName": "BubbleVPN",
"computeSizeType": "small",
"nodesIncluded": 1,
"additionalPerNodePrice": 1200,
"price": 1200,
"storageGbIncluded": 15,
"additionalStoragePerGbPrice": 2,
"bandwidthGbIncluded": 500,
"additionalBandwidthPerGbPrice": 2
}, {
"name": "bubble_plus", "name": "bubble_plus",
"chargeName": "BubblePlus", "chargeName": "BubblePlus",
"computeSizeType": "medium", "computeSizeType": "medium",
@@ -21,6 +20,17 @@
"additionalStoragePerGbPrice": 2, "additionalStoragePerGbPrice": 2,
"bandwidthGbIncluded": 1000, "bandwidthGbIncluded": 1000,
"additionalBandwidthPerGbPrice": 2 "additionalBandwidthPerGbPrice": 2
}, {
"name": "bubble_big",
"chargeName": "BubbleBig",
"computeSizeType": "large",
"nodesIncluded": 1,
"additionalPerNodePrice": 2800,
"price": 2800,
"storageGbIncluded": 70,
"additionalStoragePerGbPrice": 2,
"bandwidthGbIncluded": 4000,
"additionalBandwidthPerGbPrice": 2
}//, }//,
// { // {
// "name": "bubble_pro", // "name": "bubble_pro",


Loading…
Cancel
Save