Skip to content

Commit e319e38

Browse files
authored
Add test case for pingstatus check (#1605)
1 parent 1f78bef commit e319e38

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

aws_gate/list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def list_instances(
8888
instance_ids = []
8989
for response in instances_ssm_response_iterator:
9090
for instance in response["InstanceInformationList"]:
91-
if instance['PingStatus'] != 'Online':
91+
if instance["PingStatus"] != "Online":
9292
continue
9393
instance_ids.append(instance["InstanceId"])
9494

tests/unit/placebo/test_list/ssm.DescribeInstanceInformation_1.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@
1414
"PlatformName": "Amazon Linux",
1515
"PlatformType": "Linux",
1616
"LastPingDateTime": 1546687374.788
17+
},
18+
{
19+
"IsLatestVersion": false,
20+
"ComputerName": "ip-10-69-104-50.eu-west-1.compute.internal",
21+
"PingStatus": "Inactive",
22+
"InstanceId": "i-0c123153096cd68a6d",
23+
"IPAddress": "10.69.104.50",
24+
"ResourceType": "EC2Instance",
25+
"AgentVersion": "2.3.117.0",
26+
"PlatformVersion": "2",
27+
"PlatformName": "Amazon Linux",
28+
"PlatformType": "Linux",
29+
"LastPingDateTime": 1546687374.788
1730
}
1831
]
1932
}
20-
}
33+
}

0 commit comments

Comments
 (0)