Skip to content

Commit

Permalink
fix(MongoBinaryDownloadUrl): add support for Oracle Linux
Browse files Browse the repository at this point in the history
fixes #746
  • Loading branch information
hasezoey committed Feb 21, 2023
1 parent 0059995 commit 75fa22e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
return this.getAmazonVersionString(os);
} else if (regexHelper(/suse/i, os)) {
return this.getSuseVersionString(os);
} else if (regexHelper(/(rhel|centos|scientific)/i, os)) {
// handle "oracle linux"(ol) as "rhel", because they define "id_like: fedora", but the versions themself match up with rhel
} else if (regexHelper(/(rhel|centos|scientific|^ol$)/i, os)) {
return this.getRhelVersionString(os);
} else if (regexHelper(/fedora/i, os)) {
return this.getFedoraVersionString(os);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,42 @@ describe('MongoBinaryDownloadUrl', () => {
}
});
});

describe('Oracle Linux', () => {
it('ol 8.7 & 5.0.0 x86_64', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '5.0.0',
os: {
os: 'linux',
dist: 'ol',
release: '8.7',
id_like: ['fedora'],
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-5.0.0.tgz'
);
});

it('ol 8.7 & 4.4.17 x86_64', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '4.4.17',
os: {
os: 'linux',
dist: 'ol',
release: '8.7',
id_like: ['fedora'],
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-4.4.17.tgz'
);
});
});
});

describe('for win32 & windows', () => {
Expand Down

0 comments on commit 75fa22e

Please sign in to comment.