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