os-tester 0.2.0.dev1__tar.gz → 0.3.0.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of os-tester might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: os-tester
3
- Version: 0.2.0.dev1
3
+ Version: 0.3.0.dev1
4
4
  Summary: A Python pip package to automate testing of whole operating systems with an image recognition based approach and libvirt (qemu). Inspired by openQA.
5
5
  Author-email: Fabian Sauter <fabian.sauter+pip@apsensing.com>
6
6
  Maintainer-email: Fabian Sauter <fabian.sauter+pip@apsensing.com>
@@ -129,17 +129,11 @@ def get_vm_xml(name: str, title: str, uuid: str, isoPath: str, vmImagePath: str)
129
129
  """
130
130
 
131
131
  if __name__ == "__main__":
132
- # Load stages automation.
133
- # We expect the `stages.yml` and referenced files inside the stages directory.
134
- basePath: str = "stages"
135
- stagesObj: stages = stages(basePath)
136
- print(stagesObj)
137
-
138
132
  # Connect to qemu
139
133
  conn: libvirt.virConnect = libvirt.open("qemu:///system")
140
134
 
141
135
  uuid: str = "1e6cae9f-41d7-4fca-8033-fbd538a65173" # Replace with your (random?) UUID
142
- vmObj: vm = vm(conn, uuid, stagesObj, debugPlt=False)
136
+ vmObj: vm = vm(conn, uuid, debugPlt=False)
143
137
 
144
138
  # Delete eventually existing VMs
145
139
  if vmObj.try_load():
@@ -160,7 +154,13 @@ if __name__ == "__main__":
160
154
  )
161
155
  vmObj.create(vmXml)
162
156
 
163
- vmObj.run_stages()
157
+ # Load stages automation.
158
+ # We expect the `stages.yml` and referenced files inside the stages directory.
159
+ basePath: str = "stages"
160
+ stagesObj: stages = stages(basePath)
161
+ print(stagesObj)
162
+
163
+ vmObj.run_stages(stagesObj)
164
164
 
165
165
  print("All stages done. Exiting...")
166
166
  conn.close()
@@ -102,17 +102,11 @@ def get_vm_xml(name: str, title: str, uuid: str, isoPath: str, vmImagePath: str)
102
102
  """
103
103
 
104
104
  if __name__ == "__main__":
105
- # Load stages automation.
106
- # We expect the `stages.yml` and referenced files inside the stages directory.
107
- basePath: str = "stages"
108
- stagesObj: stages = stages(basePath)
109
- print(stagesObj)
110
-
111
105
  # Connect to qemu
112
106
  conn: libvirt.virConnect = libvirt.open("qemu:///system")
113
107
 
114
108
  uuid: str = "1e6cae9f-41d7-4fca-8033-fbd538a65173" # Replace with your (random?) UUID
115
- vmObj: vm = vm(conn, uuid, stagesObj, debugPlt=False)
109
+ vmObj: vm = vm(conn, uuid, debugPlt=False)
116
110
 
117
111
  # Delete eventually existing VMs
118
112
  if vmObj.try_load():
@@ -133,7 +127,13 @@ if __name__ == "__main__":
133
127
  )
134
128
  vmObj.create(vmXml)
135
129
 
136
- vmObj.run_stages()
130
+ # Load stages automation.
131
+ # We expect the `stages.yml` and referenced files inside the stages directory.
132
+ basePath: str = "stages"
133
+ stagesObj: stages = stages(basePath)
134
+ print(stagesObj)
135
+
136
+ vmObj.run_stages(stagesObj)
137
137
 
138
138
  print("All stages done. Exiting...")
139
139
  conn.close()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "os-tester"
7
- version = "0.2.0.dev1"
7
+ version = "0.3.0.dev1"
8
8
  authors = [
9
9
  { name="Fabian Sauter", email="fabian.sauter+pip@apsensing.com" }
10
10
  ]
@@ -25,19 +25,16 @@ class vm:
25
25
  debugPlt: bool
26
26
 
27
27
  vmDom: Optional[libvirt.virDomain]
28
- stagesObj: stages
29
28
  debugPlotObj: debugPlot
30
29
 
31
30
  def __init__(
32
31
  self,
33
32
  conn: libvirt.virConnect,
34
33
  uuid: str,
35
- stagesObj: stages,
36
34
  debugPlt: bool = False,
37
35
  ):
38
36
  self.conn = conn
39
37
  self.uuid = uuid
40
- self.stagesObj = stagesObj
41
38
  self.debugPlt = debugPlt
42
39
  if self.debugPlt:
43
40
  self.debugPlotObj = debugPlot()
@@ -184,12 +181,12 @@ class vm:
184
181
  duration: float = time() - start
185
182
  print(f"Stage '{stageObj.name}' finished after {duration}s.")
186
183
 
187
- def run_stages(self) -> None:
184
+ def run_stages(self, stagesObj: stages) -> None:
188
185
  """
189
186
  Executes all stages defined for the current VM and awaits every stage to finish before returning.
190
187
  """
191
188
  stageObj: stage
192
- for stageObj in self.stagesObj.stagesList:
189
+ for stageObj in stagesObj.stagesList:
193
190
  self.__run_stage(stageObj)
194
191
 
195
192
  def try_load(self) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: os-tester
3
- Version: 0.2.0.dev1
3
+ Version: 0.3.0.dev1
4
4
  Summary: A Python pip package to automate testing of whole operating systems with an image recognition based approach and libvirt (qemu). Inspired by openQA.
5
5
  Author-email: Fabian Sauter <fabian.sauter+pip@apsensing.com>
6
6
  Maintainer-email: Fabian Sauter <fabian.sauter+pip@apsensing.com>
@@ -129,17 +129,11 @@ def get_vm_xml(name: str, title: str, uuid: str, isoPath: str, vmImagePath: str)
129
129
  """
130
130
 
131
131
  if __name__ == "__main__":
132
- # Load stages automation.
133
- # We expect the `stages.yml` and referenced files inside the stages directory.
134
- basePath: str = "stages"
135
- stagesObj: stages = stages(basePath)
136
- print(stagesObj)
137
-
138
132
  # Connect to qemu
139
133
  conn: libvirt.virConnect = libvirt.open("qemu:///system")
140
134
 
141
135
  uuid: str = "1e6cae9f-41d7-4fca-8033-fbd538a65173" # Replace with your (random?) UUID
142
- vmObj: vm = vm(conn, uuid, stagesObj, debugPlt=False)
136
+ vmObj: vm = vm(conn, uuid, debugPlt=False)
143
137
 
144
138
  # Delete eventually existing VMs
145
139
  if vmObj.try_load():
@@ -160,7 +154,13 @@ if __name__ == "__main__":
160
154
  )
161
155
  vmObj.create(vmXml)
162
156
 
163
- vmObj.run_stages()
157
+ # Load stages automation.
158
+ # We expect the `stages.yml` and referenced files inside the stages directory.
159
+ basePath: str = "stages"
160
+ stagesObj: stages = stages(basePath)
161
+ print(stagesObj)
162
+
163
+ vmObj.run_stages(stagesObj)
164
164
 
165
165
  print("All stages done. Exiting...")
166
166
  conn.close()
File without changes
File without changes