mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-26 02:31:40 +00:00
fix(ssh): use fresh connections for connect automation
This commit is contained in:
1 parent
29df6216ed
commit
9d876cf6d5
10 files changed
+148
-10
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
appendHostConnectScript,
|
||||
getGlobalConnectScripts,
|
||||
getHostConnectScriptIds,
|
||||
hasHostConnectAutomation,
|
||||
migrateHostConnectScriptIds,
|
||||
reorderHostConnectScript,
|
||||
removeHostConnectScript,
|
||||
@@ -54,6 +55,25 @@ test('resolveConnectScriptsForHost runs globals before host queue and dedupes',
|
||||
assert.deepEqual(resolved.map((item) => item.id), ['global', 'both', 'host-only']);
|
||||
});
|
||||
|
||||
test('hasHostConnectAutomation covers host, global, and unresolved connect scripts', () => {
|
||||
assert.equal(
|
||||
hasHostConnectAutomation(
|
||||
{ ...host, connectScriptIds: ['host-script'] },
|
||||
[script({ id: 'host-script', targets: ['host-a'] })],
|
||||
),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
hasHostConnectAutomation(host, [script({ id: 'global', targetsAllHosts: true })]),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
hasHostConnectAutomation({ ...host, loginScriptId: 'not-loaded-yet' }, []),
|
||||
true,
|
||||
);
|
||||
assert.equal(hasHostConnectAutomation(host, []), false);
|
||||
});
|
||||
|
||||
test('append updates host connectScriptIds order', () => {
|
||||
const snippets = [
|
||||
script({ id: 'a', targets: ['host-a'] }),
|
||||
|
||||
Reference in new issue
Block a user