File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed
tests/integration/awslambda Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
import json
2
2
import os
3
- import platform
4
3
from typing import Literal
5
4
6
5
from localstack .utils .common import to_str
@@ -127,7 +126,3 @@ def is_new_provider():
<
8000
code>127 126
return os .environ .get ("TEST_TARGET" ) != "AWS_CLOUD" and os .environ .get (
128
127
"PROVIDER_OVERRIDE_LAMBDA"
129
128
) in ["asf" , "v2" ]
130
-
131
-
132
- def is_arm_compatible ():
133
- return platform .machine () == "arm64"
Original file line number Diff line number Diff line change @@ -28,14 +28,21 @@ def is_redhat() -> bool:
28
28
return "rhel" in load_file ("/etc/os-release" , "" )
29
29
30
30
31
+ class Arch (str ):
32
+ """LocalStack standardised machine architecture names"""
33
+
34
+ amd64 = "amd64"
35
+ arm64 = "arm64"
36
+
37
+
31
38
def standardized_arch (arch : str ):
32
39
"""
33
40
Returns LocalStack standardised machine architecture name.
34
41
"""
35
42
if arch == "x86_64" :
36
- return " amd64"
43
+ return Arch . amd64
37
44
if arch == "aarch64" :
38
- return " arm64"
45
+ return Arch . arm64
39
46
return arch
40
47
41
48
@@ -47,6 +54,11 @@ def get_arch() -> str:
47
54
return standardized_arch (arch )
48
55
49
56
57
+ def is_arm_compatible () -> bool :
58
+ """Returns true if the current machine is compatible with ARM instructions and false otherwise."""
59
+ return get_arch () == Arch .arm64
60
+
61
+
50
62
def get_os () -> str :
51
63
if is_mac_os ():
52
64
return "osx"
Original file line number Diff line number Diff line change 16
16
from localstack .testing .aws .lambda_utils import (
17
17
concurrency_update_done ,
18
18
get_invoke_init_type ,
19
- is_arm_compatible ,
20
19
is_old_provider ,
21
20
update_done ,
22
21
)
27
26
from localstack .utils import files , platform , testutil
28
27
from localstack .utils .files import load_file
29
28
from localstack .utils .http import safe_requests
30
- from localstack .utils .platform import standardized_arch
29
+ from localstack .utils .platform import is_arm_compatible , standardized_arch
31
30
from localstack .utils .strings import short_uid , to_bytes , to_str
32
31
from localstack .utils .sync import retry , wait_until
33
32
from localstack .utils .testutil import create_lambda_archive
You can’t perform that action at this time.
0 commit comments