Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E tests for java system discovery #2839

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ jobs:
photofinish run hana-diskless-sbd -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"
photofinish run multi-tenant -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"
photofinish run hana-scale-up-angi -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"
photofinish run java-system -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY"

obs-commit-image:
name: Commit to OBS to generate container image
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,5 @@ jobs:
photofinish run hana-scale-out -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run hana-diskless-sbd -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run multi-tenant -u "https://$TRENTO_PR_ENV_URL/api/v1/collect"
photofinish run hana-scale-up-angi -u "https://$TRENTO_PR_ENV_URL/api/collect"
photofinish run hana-scale-up-angi -u "https://$TRENTO_PR_ENV_URL/api/collect"
photofinish run java-system -u "https://$TRENTO_PR_ENV_URL/api/collect"
4 changes: 4 additions & 0 deletions .photofinish.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ directories = ["./test/fixtures/scenarios/gcp-landscape"]

directories = ["./test/fixtures/scenarios/multi-tenant"]

[java-system]

directories = ["./test/fixtures/scenarios/sap-system-java"]

[sap-system-detail-GRAY]

files = [
Expand Down
30 changes: 28 additions & 2 deletions test/e2e/cypress/e2e/sap_systems_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createUserRequestFactory } from '@lib/test-utils/factories';

import {
availableSAPSystems,
availableJavaSystem,
isHanaInstace,
isHanaPrimary,
isHanaSecondary,
Expand Down Expand Up @@ -64,7 +65,7 @@ context('SAP Systems Overview', () => {
cy.url().should('include', '/sap_systems');
});
availableSAPSystems.forEach(
({ sid: sid, attachedDatabase: attachedDatabase }) => {
({ sid: sid, attachedDatabase: attachedDatabase, type: type }) => {
it(`should show the expected attached database details`, () => {
cy.get('td')
.contains(sid)
Expand All @@ -73,7 +74,7 @@ context('SAP Systems Overview', () => {
.within(() => {
cy.get('td').eq(2).contains(attachedDatabase.sid);
cy.get('td').eq(3).contains(attachedDatabase.tenant);

cy.get('td').eq(4).contains(type);
cy.get('td').eq(5).contains(attachedDatabase.dbAddress);
});
});
Expand Down Expand Up @@ -212,6 +213,31 @@ context('SAP Systems Overview', () => {
});
});
});

describe('JAVA system discovery', () => {
before(() => {
cy.loadScenario('multi-tenant');
cy.loadScenario('java-system');
cy.visit('/sap_systems');
cy.url().should('include', '/sap_systems');
});

after(() => {
availableJavaSystem.instances.forEach(({ hostID }) => {
cy.deregisterHost(hostID);
});
});

it(`should discover a JAVA system`, () => {
cy.get('td')
.contains(availableJavaSystem.sid)
.parent('td')
.parent('tr')
.within(() => {
cy.get('td').eq(4).contains(availableJavaSystem.type);
});
});
});
});

describe('SAP Systems Tagging', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const availableSAPSystems = [
sid: 'NWD',
id: '67b247e4-ab5b-5094-993a-a4fd70d0e8d1',
health: 'GREEN',
type: 'ABAP',
attachedDatabase: {
sid: 'HDD',
id: 'f534a4ad-cef7-5234-b196-e67082ffb50c',
Expand Down Expand Up @@ -107,6 +108,7 @@ export const availableSAPSystems = [
id: 'eb7bc03e-166f-5ed0-b22d-79672d110d04',
sid: 'NWP',
health: 'GREEN',
type: 'ABAP',
attachedDatabase: {
sid: 'HDP',
id: '6c9208eb-a5bb-57ef-be5c-6422dedab602',
Expand Down Expand Up @@ -193,6 +195,7 @@ export const availableSAPSystems = [
id: '6748d2dd-b5a1-5599-895c-d1308b2d6541',
sid: 'NWQ',
health: 'GREEN',
type: 'ABAP',
attachedDatabase: {
sid: 'HDQ',
id: 'cd52e571-c897-5bba-b0f9-e155ceca1fff',
Expand Down Expand Up @@ -276,3 +279,16 @@ export const availableSAPSystems = [
tag: 'env2',
},
];

export const availableJavaSystem = {
sid: 'NWJ',
type: 'JAVA',
instances: [
{ hostID: 'a18a203d-4f2f-4d21-b9a5-e300a9c5eeee' },
{ hostID: '544cbc99-c856-4b0a-88cf-e6b8db4606f6' },
{ hostID: 'c0ecf7d1-bdd3-4c29-b768-cfb97efcc585' },
{ hostID: 'e0564d66-be9e-4763-9917-655af1bb4b58' },
{ hostID: 'edf755fd-abc7-4883-af81-8b06d836db37' },
{ hostID: 'f7a8969b-db9e-4162-b82a-d5cfafe1c4e9' },
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,26 @@
"SqlPort": "30344",
"User": "",
"UserId": ""
},
{
"Active": "yes",
"Container": "",
"Database": "HTJ",
"Group": "",
"GroupId": "",
"Host": "hanadb3",
"SqlPort": "30348",
"User": "",
"UserId": ""
}
],
"Id": "c0725f6b267f4216ba03be128ce08b27",
"Instances": [
{
"HdbnsutilSRstate": { "mode": "none", "online": "true" },
"HdbnsutilSRstate": {
"mode": "none",
"online": "true"
},
"Host": "hanadb3",
"HostConfiguration": {
"host/hanadb3/workerActualGroups": "-",
Expand Down Expand Up @@ -227,7 +241,9 @@
}
]
},
"SystemReplication": { "local_site_id": "0" },
"SystemReplication": {
"local_site_id": "0"
},
"Type": 1
}
],
Expand All @@ -245,4 +261,4 @@
],
"discovery_type": "sap_system_discovery",
"agent_id": "544cbc99-c856-4b0a-88cf-e6b8db4606f6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,26 @@
"SqlPort": "30344",
"User": "",
"UserId": ""
},
{
"Active": "yes",
"Container": "",
"Database": "HTJ",
"Group": "",
"GroupId": "",
"Host": "hanadb3",
"SqlPort": "30348",
"User": "",
"UserId": ""
}
],
"Id": "c0725f6b267f4216ba03be128ce08b27",
"Instances": [
{
"HdbnsutilSRstate": { "mode": "none", "online": "true" },
"HdbnsutilSRstate": {
"mode": "none",
"online": "true"
},
"Host": "hanadb2",
"HostConfiguration": {
"host/hanadb3/workerActualGroups": "-",
Expand Down Expand Up @@ -236,7 +250,9 @@
}
]
},
"SystemReplication": { "local_site_id": "0" },
"SystemReplication": {
"local_site_id": "0"
},
"Type": 1
}
],
Expand All @@ -254,4 +270,4 @@
],
"discovery_type": "sap_system_discovery",
"agent_id": "e0564d66-be9e-4763-9917-655af1bb4b58"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,26 @@
"SqlPort": "30344",
"User": "",
"UserId": ""
},
{
"Active": "yes",
"Container": "",
"Database": "HTJ",
"Group": "",
"GroupId": "",
"Host": "hanadb3",
"SqlPort": "30348",
"User": "",
"UserId": ""
}
],
"Id": "c0725f6b267f4216ba03be128ce08b27",
"Instances": [
{
"HdbnsutilSRstate": { "mode": "none", "online": "true" },
"HdbnsutilSRstate": {
"mode": "none",
"online": "true"
},
"Host": "hanadb1",
"HostConfiguration": {
"host/hanadb3/workerActualGroups": "-",
Expand Down Expand Up @@ -236,7 +250,9 @@
}
]
},
"SystemReplication": { "local_site_id": "0" },
"SystemReplication": {
"local_site_id": "0"
},
"Type": 1
}
],
Expand All @@ -254,4 +270,4 @@
],
"discovery_type": "sap_system_discovery",
"agent_id": "f7a8969b-db9e-4162-b82a-d5cfafe1c4e9"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"agent_id": "a18a203d-4f2f-4d21-b9a5-e300a9c5eeee",
"discovery_type": "cloud_discovery",
"payload": {
"Metadata": {
"compute": {
"azEnvironment": "AzurePublicCloud",
"isHostCompatibilityLayerVm": "true",
"location": "westeurope",
"name": "vmnwjava01",
"offer": "sles-sap-15-sp5-byos",
"osProfile": {
"adminUsername": "cloudadmin",
"computerName": "vmnwjava01",
"disablePasswordAuthentication": "true"
},
"osType": "Linux",
"plan": {},
"platformFaultDomain": "0",
"platformUpdateDomain": "0",
"provider": "Microsoft.Compute",
"publisher": "suse",
"resourceGroupName": "java-system",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/java-system/providers/Microsoft.Compute/virtualMachines/vmnwjava01",
"securityProfile": {
"secureBootEnabled": "true",
"virtualTpmEnabled": "true"
},
"sku": "gen2",
"storageProfile": {
"imageReference": {
"offer": "sles-sap-15-sp5-byos",
"publisher": "suse",
"sku": "gen2",
"version": "latest"
},
"osDisk": {
"caching": "ReadWrite",
"createOption": "FromImage",
"diffDiskSettings": {
"option": ""
},
"diskSizeGB": "30",
"encryptionSettings": {
"enabled": "false"
},
"image": {
"uri": ""
},
"managedDisk": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/java-system/providers/Microsoft.Compute/disks/vmnwjava01_OsDisk_1",
"storageAccountType": "Premium_LRS"
},
"name": "vmnwjava01_OsDisk_1",
"osType": "Linux",
"vhd": {
"uri": ""
},
"writeAcceleratorEnabled": "false"
}
},
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"tags": "",
"version": "2024.05.08",
"vmId": "4c94f16f-9028-4d76-9dc6-6c7894307420",
"vmSize": "Standard_D2s_v3"
},
"network": {
"interface": [
{
"ipv4": {
"ipAddress": [
{
"privateIpAddress": "10.23.0.6"
}
],
"subnet": [
{
"address": "10.23.0.0",
"prefix": "24"
}
]
},
"ipv6": {},
"macAddress": "AEE47C8D414E"
}
]
}
},
"Provider": "azure"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"agent_id": "a18a203d-4f2f-4d21-b9a5-e300a9c5eeee",
"discovery_type": "host_discovery",
"payload": {
"agent_version": "2.3.0",
"cpu_count": 2,
"fully_qualified_domain_name": "vmnwjava01.ax.internal.cloudapp.net",
"hostname": "vmnwjava01",
"installation_source": "Suse",
"ip_addresses": [
"127.0.0.1",
"::1",
"10.23.0.6",
"fe80::222:48ff:fe8b:756f"
],
"netmasks": [
"8",
"128",
"24",
"64"
],
"os_version": "15-SP5",
"socket_count": 1,
"total_memory_mb": 7888
}
}
Loading
Loading