-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
130 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
oonipipeline/src/oonipipeline/transforms/nettests/openvpn.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from typing import List, Tuple | ||
from oonidata.models.nettests import OpenVPN | ||
from oonidata.models.observations import OpenVPNObservation | ||
|
||
from ..measurement_transformer import MeasurementTransformer | ||
|
||
|
||
class OpenVPNTransformer(MeasurementTransformer): | ||
def make_observations(self, msmt: OpenVPN) -> Tuple[List[OpenVPNObservation]]: | ||
openvpn_obs_list = [] | ||
if not msmt.test_keys: | ||
return (openvpn_obs_list,) | ||
|
||
tcp_observations = self.make_tcp_observations(msmt.tcp_connect) | ||
|
||
return self.make_openvpn_observations( | ||
tcp_observations=tcp_observations, | ||
openvpn_handshakes=msmt.openvpn_handshake, | ||
network_events=msmt.network_events, | ||
bootstrap_time=msmt.bootstrap_time, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters