feat(exports): export datagram handler types and align tests with updated nftables and route security APIs
This commit is contained in:
@@ -79,18 +79,23 @@ testFn('NFTables integration tests', async () => {
|
||||
const status = await smartProxy.getNfTablesStatus();
|
||||
console.log('NFTables status:', JSON.stringify(status, null, 2));
|
||||
|
||||
expect(Object.keys(status).length).toEqual(routes.length);
|
||||
if (!status) {
|
||||
throw new Error('Expected NFTables status after SmartProxy start');
|
||||
}
|
||||
|
||||
for (const routeStatus of Object.values(status)) {
|
||||
expect(routeStatus.active).toBeTrue();
|
||||
expect(routeStatus.ruleCount.total).toBeGreaterThan(0);
|
||||
expect(status.activeGroups).toEqual(routes.length);
|
||||
expect(Object.keys(status.groups).length).toEqual(routes.length);
|
||||
|
||||
for (const routeStatus of Object.values(status.groups)) {
|
||||
expect(routeStatus.ruleCount).toBeGreaterThan(0);
|
||||
expect(routeStatus.createdAt).toBeGreaterThan(0);
|
||||
}
|
||||
|
||||
await smartProxy.stop();
|
||||
console.log('SmartProxy stopped');
|
||||
|
||||
const finalStatus = await smartProxy.getNfTablesStatus();
|
||||
expect(Object.keys(finalStatus).length).toEqual(0);
|
||||
expect(finalStatus).toEqual(null);
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
|
||||
Reference in New Issue
Block a user