11# pyright: reportAttributeAccessIssue=false
2- """Integration test for the DC-3 demo workflow.
2+ """Integration test for the Arista DC demo workflow.
33
44This test validates the complete workflow from the README:
551. Load schemas
662. Load bootstrap data
773. Add repository
884. Create branch
9- 5. Load DC-3 design data
9+ 5. Load dc-arista design data
10106. Run DC generator
11117. Create proposed change
12128. Validate and merge
3232
3333
3434class TestDCWorkflow (TestInfrahubDockerWithClient ):
35- """Test the complete DC-3 workflow from the demo."""
35+ """Test the complete DC workflow from the demo."""
3636
3737 @pytest .fixture (scope = "class" )
3838 def default_branch (self ) -> str :
3939 """Default branch for testing."""
40- return "add-dc3 "
40+ return "add-dc-arista "
4141
4242 def test_01_schema_load (self , client_main : InfrahubClientSync ) -> None :
4343 """Load all schemas into Infrahub."""
@@ -164,44 +164,44 @@ def test_06_create_branch(
164164 client_main .branch .create (default_branch , wait_until_completion = True )
165165 logging .info ("Created branch: %s" , default_branch )
166166
167- def test_07_load_dc3_design (
167+ def test_07_load_dc_design (
168168 self , client_main : InfrahubClientSync , default_branch : str
169169 ) -> None :
170- """Load DC-3 design data onto the branch."""
171- logging .info ("Starting test: test_07_load_dc3_design " )
170+ """Load dc-arista design data onto the branch."""
171+ logging .info ("Starting test: test_07_load_dc_design " )
172172
173- load_dc3 = self .execute_command (
173+ load_dc = self .execute_command (
174174 f"infrahubctl object load objects/dc/dc-arista-s.yml --branch { default_branch } " ,
175175 address = client_main .config .address ,
176176 )
177177
178- logging .info ("DC-3 design load output: %s" , load_dc3 .stdout )
179- assert load_dc3 .returncode == 0 , (
180- f"DC-3 design load failed: { load_dc3 .stdout } \n { load_dc3 .stderr } "
178+ logging .info ("DC design load output: %s" , load_dc .stdout )
179+ assert load_dc .returncode == 0 , (
180+ f"DC design load failed: { load_dc .stdout } \n { load_dc .stderr } "
181181 )
182182
183- async def test_08_verify_dc3_created (
183+ async def test_08_verify_dc_created (
184184 self , async_client_main : InfrahubClient , default_branch : str
185185 ) -> None :
186- """Verify that DC-3 topology object was created."""
187- logging .info ("Starting test: test_08_verify_dc3_created " )
186+ """Verify that dc-arista topology object was created."""
187+ logging .info ("Starting test: test_08_verify_dc_created " )
188188
189189 client = async_client_main
190190 client .default_branch = default_branch
191191
192192 # Wait a moment for data to be fully committed
193193 time .sleep (5 )
194194
195- # Query for DC-3
196- dc3 = await client .get (
195+ # Query for dc-arista
196+ dc = await client .get (
197197 kind = "TopologyDataCenter" ,
198- name__value = "DC-3 " ,
198+ name__value = "dc-arista " ,
199199 populate_store = True ,
200200 )
201201
202- assert dc3 , "DC-3 topology not found"
203- assert dc3 .name .value == "DC-3 " , f"Expected DC-3 , got { dc3 .name .value } "
204- logging .info ("DC-3 topology verified: %s" , dc3 .name .value )
202+ assert dc , "dc-arista topology not found"
203+ assert dc .name .value == "dc-arista " , f"Expected dc-arista , got { dc .name .value } "
204+ logging .info ("dc-arista topology verified: %s" , dc .name .value )
205205
206206 async def test_09_run_generator (
207207 self , async_client_main : InfrahubClient , default_branch : str
@@ -252,15 +252,15 @@ async def test_09_run_generator(
252252 # Switch to target branch for running the generator
253253 client .default_branch = default_branch
254254
255- # Get the DC-3 topology object to pass its ID to the generator
256- dc3 = await client .get (
255+ # Get the dc-arista topology object to pass its ID to the generator
256+ dc = await client .get (
257257 kind = "TopologyDataCenter" ,
258- name__value = "DC-3 " ,
258+ name__value = "dc-arista " ,
259259 populate_store = True ,
260260 )
261261
262- assert dc3 , "DC-3 topology not found before running generator"
263- logging .info ("Found DC-3 topology with ID: %s" , dc3 .id )
262+ assert dc , "dc-arista topology not found before running generator"
263+ logging .info ("Found dc-arista topology with ID: %s" , dc .id )
264264
265265 # Run the generator with the correct format
266266 # The nodes field should contain a list of node IDs to process
@@ -269,7 +269,7 @@ async def test_09_run_generator(
269269 input_data = {
270270 "data" : {
271271 "id" : definition .id ,
272- "nodes" : [dc3 .id ], # List of node IDs to run the generator on
272+ "nodes" : [dc .id ], # List of node IDs to run the generator on
273273 },
274274 "wait_until_completion" : False ,
275275 },
@@ -358,7 +358,7 @@ def test_12_create_proposed_change(
358358 mutation = "CoreProposedChangeCreate" ,
359359 input_data = {
360360 "data" : {
361- "name" : {"value" : f"Add DC-3 - Test { default_branch } " },
361+ "name" : {"value" : f"Add Arista DC - Test { default_branch } " },
362362 "source_branch" : {"value" : default_branch },
363363 "destination_branch" : {"value" : "main" },
364364 }
@@ -380,7 +380,7 @@ def test_12_create_proposed_change(
380380 while not validations_completed and attempts < max_attempts :
381381 pc = client_main .get (
382382 "CoreProposedChange" ,
383- name__value = f"Add DC-3 - Test { default_branch } " ,
383+ name__value = f"Add Arista DC - Test { default_branch } " ,
384384 include = ["validations" ],
385385 exclude = ["reviewers" , "approved_by" , "created_by" ],
386386 prefetch_relationships = True ,
@@ -453,7 +453,7 @@ def test_13_merge_proposed_change(
453453 # Get the proposed change
454454 pc = client_main .get (
455455 "CoreProposedChange" ,
456- name__value = f"Add DC-3 - Test { default_branch } " ,
456+ name__value = f"Add Arista DC - Test { default_branch } " ,
457457 )
458458
459459 logging .info ("Proposed change state: %s" , pc .state .value if hasattr (pc .state , 'value' ) else pc .state )
@@ -502,7 +502,7 @@ def test_13_merge_proposed_change(
502502 async def test_14_verify_merge_to_main (
503503 self , async_client_main : InfrahubClient
504504 ) -> None :
505- """Verify that DC-3 and devices exist in main branch."""
505+ """Verify that dc-arista and devices exist in main branch."""
506506 logging .info ("Starting test: test_14_verify_merge_to_main" )
507507
508508 client = async_client_main
@@ -512,20 +512,20 @@ async def test_14_verify_merge_to_main(
512512 logging .info ("Waiting 5 seconds for data propagation..." )
513513 time .sleep (5 )
514514
515- # Try to get DC-3 from main branch
515+ # Try to get dc-arista from main branch
516516 try :
517- dc3_main = await client .get (
517+ dc_main = await client .get (
518518 kind = "TopologyDataCenter" ,
519- name__value = "DC-3 " ,
519+ name__value = "dc-arista " ,
520520 raise_when_missing = False ,
521521 )
522522 except Exception as e :
523- logging .error ("Error querying for DC-3 in main: %s" , str (e ))
524- dc3_main = None
523+ logging .error ("Error querying for dc-arista in main: %s" , str (e ))
524+ dc_main = None
525525
526- # If DC-3 not found, query all datacenters to see what's there
527- if not dc3_main :
528- logging .info ("DC-3 not found in main, querying all datacenters..." )
526+ # If dc-arista not found, query all datacenters to see what's there
527+ if not dc_main :
528+ logging .info ("dc-arista not found in main, querying all datacenters..." )
529529 all_dcs = await client .all (kind = "TopologyDataCenter" )
530530 dc_names = [dc .name .value if hasattr (dc , 'name' ) else str (dc ) for dc in all_dcs ]
531531 logging .info ("Datacenters in main branch: %s" , dc_names )
@@ -534,15 +534,15 @@ async def test_14_verify_merge_to_main(
534534 proposed_changes = await client .all (kind = "CoreProposedChange" )
535535 logging .info ("Total proposed changes: %d" , len (proposed_changes ))
536536 for pc in proposed_changes :
537- if hasattr (pc , 'name' ) and 'DC-3 ' in pc .name .value :
537+ if hasattr (pc , 'name' ) and 'Arista DC ' in pc .name .value :
538538 pc_state = pc .state .value if hasattr (pc .state , 'value' ) else pc .state
539539 logging .info ("Found PC '%s' with state: %s" , pc .name .value , pc_state )
540540
541- assert dc3_main , (
542- "DC-3 not found in main branch after merge. "
541+ assert dc_main , (
542+ "dc-arista not found in main branch after merge. "
543543 "The merge in test_13 may have failed. Check logs above for merge task state."
544544 )
545- logging .info ("DC-3 verified in main branch" )
545+ logging .info ("dc-arista verified in main branch" )
546546
547547 # Verify devices exist in main
548548 devices_main = await client .all (kind = "DcimDevice" )
0 commit comments