diff --git a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts index cf984e169..a6ff5dac2 100644 --- a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts +++ b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts @@ -430,8 +430,8 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts { let name = 'amazon'; const release: number = parseInt(os.release, 10); - if (release >= 2 && release <= 3) { - name += '2'; + if (release >= 2) { + name += release.toString(); } // dont add anthing as fallback, because for "amazon 1", mongodb just uses "amazon" diff --git a/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts b/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts index 557c1a46d..838297677 100644 --- a/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts +++ b/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts @@ -1054,6 +1054,24 @@ describe('MongoBinaryDownloadUrl', () => { 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon2-4.0.24.tgz' ); }); + + it('should return a archive name for Amazon 2023', async () => { + const du = new MongoBinaryDownloadUrl({ + platform: 'linux', + arch: 'x64', + version: '7.0.2', + os: { + os: 'linux', + dist: 'amzn', + release: '2023', + id_like: ['fedora'], + }, + }); + + expect(await du.getDownloadUrl()).toBe( + 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon2023-7.0.2.tgz' + ); + }); }); describe('for rhel', () => {