Skip to content

Commit

Permalink
update domain/alias-related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Marketen committed Sep 25, 2023
1 parent 3c81c66 commit c7d8b91
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 29 deletions.
7 changes: 1 addition & 6 deletions packages/dappmanager/test/unit/domains.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ describe("domains", () => {
{
dnpName: "prysm.dnp.dappnode.eth",
serviceName: "prysm.dnp.dappnode.eth",
domain: "prysm.dappnode"
},
{
dnpName: "prysm.dnp.dappnode.eth",
serviceName: "prysm.dnp.dappnode.eth",
domain: "prysm.dappnode"
domain: "prysm.dnp.dappnode.eth.prysm.dappnode"
},
{
dnpName: "prysm.public.dappnode.eth",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe("setDappnodeComposeDefaults", () => {
networks: {
dncore_network: {
ipv4_address: "172.33.1.7",
aliases: ["dappmanager.dappnode", "my.dappnode", "dappnode.local"]
aliases: ["dappmanager.dnp.dappnode.eth.dappmanager.dappnode", "dappmanager.dappnode", "my.dappnode", "dappnode.local"]
}
}
}
Expand Down Expand Up @@ -247,7 +247,7 @@ describe("setDappnodeComposeDefaults", () => {
networks: {
dncore_network: {
ipv4_address: "172.33.1.7",
aliases: ["dappmanager.dappnode", "my.dappnode", "dappnode.local"]
aliases: ["dappmanager.dnp.dappnode.eth.dappmanager.dappnode", "dappmanager.dappnode", "my.dappnode", "dappnode.local"]
}
},
volumes: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const monoContainer: PackageContainer = {
...mockContainer,
containerName: "DAppNodeTest-logger.dnp.dappnode.eth",
dnpName: `${DNP_NAME_MONO}`,
serviceName: `service`,
serviceName: `${DNP_NAME_MONO}`,
isCore: false,
isMain: true,
};
Expand Down Expand Up @@ -107,7 +107,7 @@ services:
const MONO_COMPOSE = `
version: '3.4'
services:
service:
${DNP_NAME_MONO}:
image: "chentex/random-logger"
container_name: ${monoContainer.containerName}
`;
Expand Down Expand Up @@ -204,7 +204,7 @@ describe("Add alias to running containers", function() {
const containersToTest = [
{ container: containerMain, expectedAliases: ["mainService.logger.dappnode", "logger.dappnode"] },
{ container: containerNotMain, expectedAliases: ["notmainService.logger.dappnode"] },
{ container: monoContainer, expectedAliases: ["service.logger-mono.dappnode", "logger-mono.dappnode"] },
{ container: monoContainer, expectedAliases: ["logger-mono.dnp.dappnode.eth.logger-mono.dappnode", "logger-mono.dappnode"] },
{ container: monoContainerPublic, expectedAliases: ["service.logger-mono.public.dappnode", "logger-mono.public.dappnode"] },
{ container: containerMainPublic, expectedAliases: ["mainService.logger.public.dappnode", "logger.public.dappnode"] },
{ container: containerNotMainPublic, expectedAliases: ["notmainService.logger.public.dappnode"] },
Expand Down
36 changes: 18 additions & 18 deletions packages/dappmanager/test/unit/modules/nsupdate/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("modules > nsupdate", () => {
for (const [name, domain] of Object.entries(cases)) {
it(`Should get the domain of ${name}`, () => {
expect(
getDotDappnodeDomain({ dnpName: name, serviceName: name })
getDotDappnodeDomain({ dnpName: name, serviceName: "" })
).to.equal(domain);
});
}
Expand Down Expand Up @@ -139,14 +139,14 @@ update delete my.app.pinner.dnp.dappnode.eth A
update add my.app.pinner.dnp.dappnode.eth 60 A 172.33.0.5
`,
dappnode: `
update delete ipfs.dappnode A
update add ipfs.dappnode 60 A 172.33.1.5
update delete *.ipfs.dappnode A
update add *.ipfs.dappnode 60 A 172.33.1.5
update delete bitcoin.dappnode A
update add bitcoin.dappnode 60 A 172.33.0.2
update delete geth.dappnode A
update add geth.dappnode 60 A 172.33.0.3
update delete ipfs.dnp.dappnode.eth.ipfs.dappnode A
update add ipfs.dnp.dappnode.eth.ipfs.dappnode 60 A 172.33.1.5
update delete *.ipfs.dnp.dappnode.eth.ipfs.dappnode A
update add *.ipfs.dnp.dappnode.eth.ipfs.dappnode 60 A 172.33.1.5
update delete bitcoin.dnp.dappnode.eth.bitcoin.dappnode A
update add bitcoin.dnp.dappnode.eth.bitcoin.dappnode 60 A 172.33.0.2
update delete geth.dnp.dappnode.eth.geth.dappnode A
update add geth.dnp.dappnode.eth.geth.dappnode 60 A 172.33.0.3
update delete cluster.pinner.dappnode A
update add cluster.pinner.dappnode 60 A 172.33.0.4
update delete app.pinner.dappnode A
Expand All @@ -173,10 +173,10 @@ update delete my.cluster.pinner.dnp.dappnode.eth A
update delete my.app.pinner.dnp.dappnode.eth A
`,
dappnode: `
update delete ipfs.dappnode A
update delete *.ipfs.dappnode A
update delete bitcoin.dappnode A
update delete geth.dappnode A
update delete ipfs.dnp.dappnode.eth.ipfs.dappnode A
update delete *.ipfs.dnp.dappnode.eth.ipfs.dappnode A
update delete bitcoin.dnp.dappnode.eth.bitcoin.dappnode A
update delete geth.dnp.dappnode.eth.geth.dappnode A
update delete cluster.pinner.dappnode A
update delete app.pinner.dappnode A
update delete fullnode.dappnode A
Expand All @@ -197,8 +197,8 @@ update delete my.bitcoin.dnp.dappnode.eth A
update add my.bitcoin.dnp.dappnode.eth 60 A 172.33.0.2
`,
dappnode: `
update delete bitcoin.dappnode A
update add bitcoin.dappnode 60 A 172.33.0.2
update delete bitcoin.dnp.dappnode.eth.bitcoin.dappnode A
update add bitcoin.dnp.dappnode.eth.bitcoin.dappnode 60 A 172.33.0.2
`
});
});
Expand All @@ -215,7 +215,7 @@ update add bitcoin.dappnode 60 A 172.33.0.2
eth: `
update delete my.bitcoin.dnp.dappnode.eth A`,
dappnode: `
update delete bitcoin.dappnode A`
update delete bitcoin.dnp.dappnode.eth.bitcoin.dappnode A`
});
});

Expand Down Expand Up @@ -262,8 +262,8 @@ update add my.dms.dnp.dappnode.eth 60 A 172.33.0.3
dappnode: `
update delete grafana.dms.dappnode A
update add grafana.dms.dappnode 60 A 172.33.0.3
update delete dms.dappnode A
update add dms.dappnode 60 A 172.33.0.3`
update delete dms.dnp.dappnode.eth.dms.dappnode A
update add dms.dnp.dappnode.eth.dms.dappnode 60 A 172.33.0.3`
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
dncore_network:
ipv4_address: 172.33.1.7
aliases:
- "dappmanager.dnp.dappnode.eth.dappmanager.dappnode"
- "dappmanager.dappnode"
- "my.dappnode"
- "dappnode.local"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
dncore_network:
ipv4_address: 172.33.1.7
aliases:
- dappmanager.dnp.dappnode.eth.dappmanager.dappnode
- dappmanager.dappnode
- my.dappnode
- dappnode.local
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
dncore_network:
ipv4_address: 172.33.1.4
aliases:
- "vpn.dnp.dappnode.eth.vpn.dappnode"
- "vpn.dappnode"
ports:
- "1194:1194/udp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
dncore_network:
ipv4_address: 172.33.1.4
aliases:
- vpn.dnp.dappnode.eth.vpn.dappnode
- vpn.dappnode
logging:
driver: journald

0 comments on commit c7d8b91

Please sign in to comment.