This commit introduces delivery metadata tracking for gateway commands, updates, and shells. Adds preferred delivery channel handling, refined validation for edge agents, improved relay management logic, and broker presence reporting. Includes schema changes, enhanced shell handling, and test coverage.
33 lines
2.2 KiB
PHP
33 lines
2.2 KiB
PHP
<?php
|
|
|
|
it('defines the edge gateway runtime schema bootstrap tables', function (): void {
|
|
$bootstrapContent = file_get_contents(app_path('classes/edge_gateway_schema_bootstrap.php'));
|
|
|
|
expect($bootstrapContent)->not->toBeFalse();
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateways');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_claim_tokens');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_device_inventory');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_relay_bindings');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_command_jobs');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_update_jobs');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_shell_sessions');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_shell_action_jobs');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_shell_events');
|
|
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_audit_logs');
|
|
});
|
|
|
|
it('stores edge gateway heartbeats, bindings, shell transcripts, and shell polling queues', function (): void {
|
|
$bootstrapContent = file_get_contents(app_path('classes/edge_gateway_schema_bootstrap.php'));
|
|
|
|
expect($bootstrapContent)->toContain('last_heartbeat_at DATETIME NULL');
|
|
expect($bootstrapContent)->toContain('command_job_id INT NULL');
|
|
expect($bootstrapContent)->toContain('channel INT NOT NULL DEFAULT 0');
|
|
expect($bootstrapContent)->toContain('transcript_text LONGTEXT NULL');
|
|
expect($bootstrapContent)->toContain('action_type VARCHAR(32) NOT NULL');
|
|
expect($bootstrapContent)->toContain('payload_json JSON NULL');
|
|
expect($bootstrapContent)->toContain('event_type VARCHAR(32) NOT NULL');
|
|
expect($bootstrapContent)->toContain('context_json JSON NULL');
|
|
expect(substr_count($bootstrapContent, 'delivery_json JSON NULL'))->toBeGreaterThanOrEqual(3);
|
|
expect($bootstrapContent)->toContain('ADD COLUMN delivery_json JSON NULL');
|
|
});
|