Move hostname get/set to separate "module" (directory)

Signed-off-by: Christina Ying Wang <christina@balena.io>
This commit is contained in:
Christina Ying Wang
2024-04-30 20:42:13 -07:00
parent 1c81eafd7c
commit 0cf5a4bf18
5 changed files with 60 additions and 56 deletions

View File

@ -1294,18 +1294,4 @@ describe('patches host config', () => {
await actions.patchHostConfig(conf, true);
expect(hostConfigPatch).to.have.been.calledWith(conf, true);
});
it('patches hostname as first 7 digits of uuid if hostname parameter is empty string', async () => {
const conf = {
network: {
hostname: '',
},
};
const uuid = await config.get('uuid');
await actions.patchHostConfig(conf, true);
expect(hostConfigPatch).to.have.been.calledWith(
{ network: { hostname: uuid?.slice(0, 7) } },
true,
);
});
});