Bug 52183 - Create python client for Veyon Network API
Create python client for Veyon Network API
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Veyon
unspecified
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v7
Assigned To: Ole Schwiegert
Tobias Wenzel
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-05 11:47 CEST by Ole Schwiegert
Modified: 2020-12-22 08:29 CET (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Schwiegert univentionstaff 2020-10-05 11:47:26 CEST
We want a package (ucs-school-veyon-client) which provides a python lib to interface with the veyon network API developed by Tobias Junghans
Comment 1 Ole Schwiegert univentionstaff 2020-10-05 12:11:44 CEST
New package ucs-school-veyon-client in oschwieg/4.4/veyon-cli

Please check code, implementation, function, tests, debian package definitions
and manual integration tests (for test setup give me a holler)

REOPEN for errors or merge&build
Comment 2 Tobias Wenzel univentionstaff 2020-10-06 14:22:24 CEST
QA -> leaving resolved since you told me you want to fix/ move the unittests. Other than that everything looks good.

- Debian Package -> Looks good
- Code -> Looks good
- Unittests (as discussed): The build didn't succeed with the unittests. After removing them I had no problem (and running them afterwards).
- Functionalities:
 1.  Authentifizierung -> OK
 2.  one Get -> get_screenshot -> OK 
 3.  one Set -> SCREEN_LOCK & others -> OK

-----------------------------------


Functional Review within ipython:

-> I sent signals to a windows client (win01)


client = VeyonClient(http://non-existent:5589/api/v1, CREDENTIALS, AuthenticationMethod.AUTH_LOGON, "localhost")
client.ping
-> ConnectionError

client.set_feature(None, active=False)
-> VeyonError: Invalid feature -> OK

client = VeyonClient(URL, wrong_CREDENTIALS, AuthenticationMethod.AUTH_LOGON, "localhost")
-> VeyonError: Authentication failed -> OK

client.get_user_info()
Out[37]: VeyonUser(login=u'REALM2\\test.student', fullname=u'Test Student', session=0)
-> OK


client = VeyonClient(URL, CREDENTIALS, AuthenticationMethod.AUTH_LOGON, "localhost")
my_time = datetime.now()
uid = client._create_session("localhost").connection_uid
client._session_cache["localhost"] = VeyonSession(
	uid, calendar.timegm(my_time.replace(my_time.year + 1).timetuple())
)

-> no errors, I was able to set features afterwards -> OK


client.set_feature(Feature.SCREEN_LOCK, active=True)
-> client is locked -> OK

client.set_feature(Feature.SCREEN_LOCK, active=False)
-> win01 is unlocked -> OK

client.set_feature(Feature.REBOOT, active=True)
-> win01 reboots -> OK

 client.set_feature(Feature.POWER_DOWN, active=True)
-> win01 shuts down -> OK

client.set_feature(Feature.USER_LOGOFF, active=True)
-> win01 log off -> OK

 client.set_feature(Feature.INPUT_DEVICE_LOCK, active=True)
-> win01: black screen/ locked -> OK

 client.set_feature(Feature.INPUT_DEVICE_LOCK, active=False)
-> win01: nothing happens -> OK for QA, because the other features are ok. This seems to be an issue in veyon -> has to be fixed by Tobias
https://github.com/veyon/web-api/issues/6


Test what happens, if a feature is not active and I run
client.set_feature(Feature.*, active=False)
-> no errors, nothing happens on client -> OK


client.get_screenshot((screenshot_format='PNG', quality=6, compression=80)
-> PNG as bytes -> OK

jpeg-> not supported, see https://github.com/veyon/web-api/issues/4 -> OK for QA

client.get_screenshot((screenshot_format='gif', quality=6, compression=80)
-> VeyonError: Unsupported image format -> OK
Comment 3 Tobias Wenzel univentionstaff 2020-10-06 18:23:27 CEST
Thanks for fixing the unittests!
Now they are run during the build-process.

REOPEN -> please merge, build, add changelog & yaml
Comment 4 Ole Schwiegert univentionstaff 2020-10-07 09:59:51 CEST
Package: ucs-school-veyon-client
Version: 1.0.0-1A~4.4.0.202010070957
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Package build. Please confirm, that it is in maintained
Comment 5 Tobias Wenzel univentionstaff 2020-10-07 11:07:28 CEST
QA -> all OK -> VERIFY

Changelog -> OK
YAML -> OK
Merge without changes -> OK
Comment 6 Daniel Tröder univentionstaff 2020-10-12 16:18:59 CEST
UCS@school 4.4 v7 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v7-de.html

If this error occurs again, please clone this bug.