| @@ 109-130 (lines=22) @@ | ||
| 106 | ); |
|
| 107 | } |
|
| 108 | ||
| 109 | public function testConnectNotInAcl() |
|
| 110 | { |
|
| 111 | $this->assertSame( |
|
| 112 | [ |
|
| 113 | 'ok' => false, |
|
| 114 | 'error' => '[VPN] unable to connect, account not a member of required group', |
|
| 115 | ], |
|
| 116 | $this->makeRequest( |
|
| 117 | ['vpn-server-node', 'aabbcc'], |
|
| 118 | 'POST', |
|
| 119 | 'connect', |
|
| 120 | [], |
|
| 121 | [ |
|
| 122 | 'profile_id' => 'acl2', |
|
| 123 | 'common_name' => '12345678901234567890123456789012', |
|
| 124 | 'ip4' => '10.10.10.10', |
|
| 125 | 'ip6' => 'fd00:4242:4242:4242::', |
|
| 126 | 'connected_at' => 12345678, |
|
| 127 | ] |
|
| 128 | ) |
|
| 129 | ); |
|
| 130 | } |
|
| 131 | ||
| 132 | public function testDisconnect() |
|
| 133 | { |
|
| @@ 132-151 (lines=20) @@ | ||
| 129 | ); |
|
| 130 | } |
|
| 131 | ||
| 132 | public function testDisconnect() |
|
| 133 | { |
|
| 134 | $this->assertTrue( |
|
| 135 | $this->makeRequest( |
|
| 136 | ['vpn-server-node', 'aabbcc'], |
|
| 137 | 'POST', |
|
| 138 | 'disconnect', |
|
| 139 | [], |
|
| 140 | [ |
|
| 141 | 'profile_id' => 'internet', |
|
| 142 | 'common_name' => '12345678901234567890123456789012', |
|
| 143 | 'ip4' => '10.10.10.10', |
|
| 144 | 'ip6' => 'fd00:4242:4242:4242::', |
|
| 145 | 'connected_at' => 12345678, |
|
| 146 | 'disconnected_at' => 23456789, |
|
| 147 | 'bytes_transferred' => 2222222, |
|
| 148 | ] |
|
| 149 | ) |
|
| 150 | ); |
|
| 151 | } |
|
| 152 | ||
| 153 | public function testVerifyOtp() |
|
| 154 | { |
|