-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Checkbox-ce-oem] Modify job and script to support use x-test tool(Bu…
…gfix) (#1075) * Modify job and script too support use x-test tool * Modify the logic to prioritize the x-test snap * Modify the method to get xtest in gadget snap Modify the method to call python script * Separate look_up_xtest to another script
- Loading branch information
1 parent
07f2985
commit 873cccb
Showing
3 changed files
with
67 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from checkbox_support.snap_utils.snapd import Snapd | ||
from checkbox_support.snap_utils.system import get_gadget_snap | ||
|
||
|
||
def look_up_xtest(): | ||
if Snapd().list("x-test"): | ||
return "x-test.xtest" | ||
elif look_up_gadget() is not False: | ||
return look_up_gadget() | ||
else: | ||
raise SystemExit(1) | ||
|
||
|
||
def look_up_gadget(): | ||
gadget = get_gadget_snap() | ||
snap = Snapd().list(gadget) | ||
if "apps" in snap.keys(): | ||
for app in snap["apps"]: | ||
if app["name"] == "xtest": | ||
return ".".join([app["snap"], app["name"]]) | ||
return False | ||
|
||
|
||
def main(): | ||
print(look_up_xtest()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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