Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Sanitize test fixtures #538

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/integration/fixtures/Example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ interactions:
response:
body: '{"data": [{"id": 59542994, "label": "go-test-ins-3812seykyn76", "group":
"", "status": "running", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05",
"type": "g6-nanode-1", "ipv4": ["194.195.118.209"], "ipv6": "2400:8904::f03c:94ff:fe49:51ac/128",
"type": "g6-nanode-1", "ipv4": ["194.195.118.209"], "ipv6": "1234::5678/128",
"image": "linode/debian9", "region": "ap-west", "specs": {"disk": 25600, "memory":
1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in":
10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled":
Expand All @@ -75,7 +75,7 @@ interactions:
false, "placement_group": null}, {"id": 59543048, "label": "go-test-ins-wo-disk-v6p8qg0b815q",
"group": "", "status": "offline", "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05", "type": "g6-nanode-1", "ipv4": ["194.195.118.254"], "ipv6":
"2400:8904::f03c:94ff:fe49:e47f/128", "image": null, "region": "ap-west", "specs":
"1234::5678/128", "image": null, "region": "ap-west", "specs":
{"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts":
{"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io":
10000}, "backups": {"enabled": true, "available": true, "schedule": {"day":
Expand All @@ -84,7 +84,7 @@ interactions:
"has_user_data": false, "placement_group": null}, {"id": 59544188, "label":
"go-test-ins-wo-disk-k2pw744ul49t", "group": "", "status": "offline", "created":
"2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "type": "g6-nanode-1",
"ipv4": ["192.46.211.66"], "ipv6": "2400:8904::f03c:94ff:fe49:a401/128", "image":
"ipv4": ["192.46.211.66"], "ipv6": "1234::5678/128", "image":
null, "region": "ap-west", "specs": {"disk": 25600, "memory": 1024, "vcpus":
1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out":
10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": true, "available":
Expand Down Expand Up @@ -155,7 +155,7 @@ interactions:
response:
body: '{"id": 59542994, "label": "go-test-ins-3812seykyn76", "group": "", "status":
"running", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05",
"type": "g6-nanode-1", "ipv4": ["194.195.118.209"], "ipv6": "2400:8904::f03c:94ff:fe49:51ac/128",
"type": "g6-nanode-1", "ipv4": ["194.195.118.209"], "ipv6": "1234::5678/128",
"image": "linode/debian9", "region": "ap-west", "specs": {"disk": 25600, "memory":
1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in":
10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled":
Expand Down
6 changes: 3 additions & 3 deletions test/integration/fixtures/ExampleCreateNodeBalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
method: POST
response:
body: '{"id": 694136, "label": "balancer694136", "region": "us-southeast", "hostname":
"45-79-245-145.ip.linodeusercontent.com", "ipv4": "45.79.245.145", "ipv6": "2600:3c02:1::2d4f:f591",
"45-79-245-145.ip.linodeusercontent.com", "ipv4": "45.79.245.145", "ipv6": "1234::5678",
"created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "client_conn_throttle":
20, "tags": [], "transfer": {"in": null, "out": null, "total": null}}'
headers:
Expand Down Expand Up @@ -80,7 +80,7 @@ interactions:
method: GET
response:
body: '{"id": 694136, "label": "balancer694136", "region": "us-southeast", "hostname":
"45-79-245-145.ip.linodeusercontent.com", "ipv4": "45.79.245.145", "ipv6": "2600:3c02:1::2d4f:f591",
"45-79-245-145.ip.linodeusercontent.com", "ipv4": "45.79.245.145", "ipv6": "1234::5678",
"created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "client_conn_throttle":
20, "tags": [], "transfer": {"in": null, "out": null, "total": null}}'
headers:
Expand Down Expand Up @@ -147,7 +147,7 @@ interactions:
response:
body: '{"id": 694136, "label": "balancer694136_renamed", "region": "us-southeast",
"hostname": "45-79-245-145.ip.linodeusercontent.com", "ipv4": "45.79.245.145",
"ipv6": "2600:3c02:1::2d4f:f591", "created": "2018-01-02T03:04:05", "updated":
"ipv6": "1234::5678", "created": "2018-01-02T03:04:05", "updated":
"2018-01-02T03:04:05", "client_conn_throttle": 20, "tags": [], "transfer": {"in":
null, "out": null, "total": null}}'
headers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
method: POST
response:
body: '{"id": 694137, "label": "balancer694137", "region": "us-southeast", "hostname":
"45-79-244-189.ip.linodeusercontent.com", "ipv4": "45.79.244.189", "ipv6": "2600:3c02:1::2d4f:f4bd",
"45-79-244-189.ip.linodeusercontent.com", "ipv4": "45.79.244.189", "ipv6": "1234::5678",
"created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "client_conn_throttle":
20, "tags": [], "transfer": {"in": null, "out": null, "total": null}}'
headers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
method: POST
response:
body: '{"id": 694138, "label": "balancer694138", "region": "us-southeast", "hostname":
"45-79-245-36.ip.linodeusercontent.com", "ipv4": "45.79.245.36", "ipv6": "2600:3c02:1::2d4f:f524",
"45-79-245-36.ip.linodeusercontent.com", "ipv4": "45.79.245.36", "ipv6": "1234::5678",
"created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "client_conn_throttle":
20, "tags": [], "transfer": {"in": null, "out": null, "total": null}}'
headers:
Expand Down Expand Up @@ -148,7 +148,7 @@ interactions:
response:
body: '{"id": 59541321, "label": "nodebalancer-example-instance", "group": "",
"status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05",
"type": "g6-nanode-1", "ipv4": ["45.79.253.187"], "ipv6": "2600:3c02::f03c:94ff:fe49:735b/128",
"type": "g6-nanode-1", "ipv4": ["45.79.253.187"], "ipv6": "1234::5678/128",
"image": "linode/debian9", "region": "us-southeast", "specs": {"disk": 25600,
"memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu":
90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000},
Expand Down
16 changes: 8 additions & 8 deletions test/integration/fixtures/ExampleListStackscripts_page1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ interactions:
1;\n fi\n \n hostnamectl set-hostname $1\n sed -i \"s/ubuntu/$1/g\"
/etc/hosts\n}\n\nfunction ubuntu1604_update {\n\t# Configures Apt, disables
interactive prompt, updates repositories and upgrades system packages.\n\n\t#
Forces Apt to use IPv4\n\techo ''Acquire::ForceIPv4 \"true\";'' > /etc/apt/apt.conf.d/99force-ipv4\n\t#
Forces Apt to use IPv4\n\techo ''Acquir1234::5678orceIPv4 \"true\";'' > /etc/apt/apt.conf.d/99force-ipv4\n\t#
Disables interactive prompts\n\texport DEBIAN_FRONTEND=noninteractive\n\t# Updates
Repositories and Upgrades Packages\n\tapt-get update && apt-get upgrade -y\n}\n\nfunction
ubuntu1604_install_additional {\n\t# Install additional system packages\n\t\n\tapt-get
Expand Down Expand Up @@ -303,7 +303,7 @@ interactions:
]; then\n echo \"Hostname Not Defined.\"\n return 1;\n fi\n \n hostnamectl
set-hostname $1\n sed -i \"s/debian/$1/g\" /etc/hosts\n}\n\nfunction debian8_update
{\n\t# Configures Apt, disables interactive prompt, updates repositories and
upgrades system packages.\n\n\t# Forces Apt to use IPv4\n\techo ''Acquire::ForceIPv4
upgrades system packages.\n\n\t# Forces Apt to use IPv4\n\techo ''Acquir1234::5678orceIPv4
\"true\";'' > /etc/apt/apt.conf.d/99force-ipv4\n\t# Disables interactive prompts\n\texport
DEBIAN_FRONTEND=noninteractive\n\t# Updates Repositories and Upgrades Packages\n\tapt-get
update && apt-get upgrade -y\n}\n\nfunction debian8_install_additional {\n\t#
Expand Down Expand Up @@ -532,7 +532,7 @@ interactions:
LOG --log-prefix \"iptables_INPUT_denied: \" --log-level 7\n\tiptables -A INPUT
-j REJECT\n\tiptables -A FORWARD -m limit --limit 5/min -j LOG --log-prefix
\"iptables_FORWARD_denied: \" --log-level 7\n\tiptables -A FORWARD -j REJECT\n\tip6tables
-A INPUT -i lo -j ACCEPT\n\tip6tables -A INPUT ! -i lo -s ::1/128 -j REJECT\n\tip6tables
-A INPUT -i lo -j ACCEPT\n\tip6tables -A INPUT ! -i lo -s 1234::5678/128 -j REJECT\n\tip6tables
-A INPUT -p icmpv6 -j ACCEPT\n\tip6tables -A INPUT -p tcp --dport 80 -m state
--state NEW -j ACCEPT\n\tip6tables -A INPUT -p tcp --dport 443 -m state --state
NEW -j ACCEPT\n\tip6tables -A INPUT -m state --state ESTABLISHED,RELATED -j
Expand All @@ -553,7 +553,7 @@ interactions:
LOG --log-prefix \"iptables_INPUT_denied: \" --log-level 7\n\tiptables -A INPUT
-j REJECT\n\tiptables -A FORWARD -m limit --limit 5/min -j LOG --log-prefix
\"iptables_FORWARD_denied: \" --log-level 7\n\tiptables -A FORWARD -j REJECT\n\tip6tables
-A INPUT -i lo -j ACCEPT\n\tip6tables -A INPUT ! -i lo -s ::1/128 -j REJECT\n\tip6tables
-A INPUT -i lo -j ACCEPT\n\tip6tables -A INPUT ! -i lo -s 1234::5678/128 -j REJECT\n\tip6tables
-A INPUT -p icmpv6 -j ACCEPT\n\tip6tables -A INPUT -p tcp --dport 80 -m state
--state NEW -j ACCEPT\n\tip6tables -A INPUT -p tcp --dport 443 -m state --state
NEW -j ACCEPT\n\tip6tables -A INPUT -m state --state ESTABLISHED,RELATED -j
Expand All @@ -577,7 +577,7 @@ interactions:
\" --log-level 7\n\tiptables -A INPUT -j REJECT\n\tiptables -A FORWARD -m limit
--limit 5/min -j LOG --log-prefix \"iptables_FORWARD_denied: \" --log-level
7\n\tiptables -A FORWARD -j REJECT\n\tip6tables -A INPUT -i lo -j ACCEPT\n\tip6tables
-A INPUT ! -i lo -s ::1/128 -j REJECT\n\tip6tables -A INPUT -p icmpv6 -j ACCEPT\n\tip6tables
-A INPUT ! -i lo -s 1234::5678/128 -j REJECT\n\tip6tables -A INPUT -p icmpv6 -j ACCEPT\n\tip6tables
-A INPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT\n\tip6tables -A INPUT
-p tcp --dport 443 -m state --state NEW -j ACCEPT\n\tip6tables -A INPUT -m state
--state ESTABLISHED,RELATED -j ACCEPT\n\tip6tables -A INPUT -m limit --limit
Expand Down Expand Up @@ -2206,7 +2206,7 @@ interactions:
"2018-01-02T03:04:05", "rev_note": "move apt-get upgrade to end of script to
prevent busted nf_conntrack kernel modules for UFW - cmullen ", "script": "#!/bin/bash\n#
Used for Marketplace Apps\n# Helper functions\n\nfunction apt_setup_update {\n #
Force IPv4 and noninteractive update\n echo ''Acquire::ForceIPv4 \"true\";''
Force IPv4 and noninteractive update\n echo ''Acquir1234::5678orceIPv4 \"true\";''
> /etc/apt/apt.conf.d/99force-ipv4\n export DEBIAN_FRONTEND=noninteractive\n apt-get
update -y\n}\n\nfunction set_hostname {\n IP=`hostname -I | awk ''{print$1}''`\n HOSTNAME=`dnsdomainname
-A`\n hostnamectl set-hostname $HOSTNAME\n echo $IP $HOSTNAME >> /etc/hosts\n}\n\nfunction
Expand All @@ -2232,7 +2232,7 @@ interactions:
-y\n cd /etc/fail2ban\n cp fail2ban.conf fail2ban.local\n cp jail.conf jail.local\n systemctl
start fail2ban\n systemctl enable fail2ban\n cd\n}\n\nfunction stackscript_cleanup
{\n # Force IPv4 and noninteractive upgrade after script runs to prevent breaking
nf_conntrack for UFW\n echo ''Acquire::ForceIPv4 \"true\";'' > /etc/apt/apt.conf.d/99force-ipv4\n export
nf_conntrack for UFW\n echo ''Acquir1234::5678orceIPv4 \"true\";'' > /etc/apt/apt.conf.d/99force-ipv4\n export
DEBIAN_FRONTEND=noninteractive \n apt-get upgrade -y\n\n rm /root/StackScript\n rm
/root/ssinclude*\n echo \"Installation complete!\"\n}\n\nfunction run_mysql_secure_installation
{\n # Installs expect, runs mysql_secure_installation and runs mysql secure
Expand Down Expand Up @@ -3270,7 +3270,7 @@ interactions:
"updated": "2018-01-02T03:04:05", "rev_note": "", "script": "#!/usr/bin/bash\n\n##
REQUIRED IN EVERY MARKETPLACE SUBMISSION\n# Add Logging to /var/log/stackscript.log
for future troubleshooting\nexec 1> >(tee -a \"/var/log/stackscript.log\") 2>&1\n#
System Updates updates\napt-get -o Acquire::ForceIPv4=true update -y\n## END
System Updates updates\napt-get -o Acquir1234::5678orceIPv4=true update -y\n## END
OF REQUIRED CODE FOR MARKETPLACE SUBMISSION\n\n# Install docker\ncurl -fsSL
get.docker.com | sudo sh\n\n# Creating Password\necho \"Superinsight setting
up password....\"\nADMIN_PASSWORD=$(openssl rand -hex 12)\nNODE_IP=$(hostname
Expand Down
26 changes: 15 additions & 11 deletions test/integration/fixtures/TestAccount_Get.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ interactions:
url: https://api.linode.com/v4beta/account
method: GET
response:
body: '{"company": "Linode", "email": "foo@linode.com", "first_name": "foo",
"last_name": "bar", "address_1": "123 Street Street", "address_2": "NA",
"city": "Philadelphia", "state": "PA", "zip": "30000", "country": "US", "phone":
"1234567891", "balance": 0.0, "tax_id": "", "billing_source": "linode", "credit_card":
{"last_four": "1234", "expiry": "02/2020"}, "balance_uninvoiced": 0.0, "active_since":
"2018-01-02T03:04:05", "capabilities": ["Linodes", "NodeBalancers", "Block Storage",
"Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "LKE HA Control Planes",
"Machine Images", "Managed Databases"], "active_promotions": [], "euuid": "FFFFFFFF-2E4D-47CE-FFFFFFFFFFFFFFFFF"}'
body: '{"company": "Akamai", "email": "ykim@akamai.com", "first_name": "Youjung",
"last_name": "Kim", "address_1": "", "address_2": "", "city": "", "state": "",
"zip": "", "country": "", "phone": "", "balance": 0.0, "tax_id": "", "billing_source":
"linode", "credit_card": {"last_four": null, "expiry": null}, "balance_uninvoiced":
0.0, "active_since": "2018-01-02T03:04:05", "capabilities": ["Linodes", "NodeBalancers",
"Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans",
"LKE HA Control Planes", "Machine Images", "Managed Databases", "VPCs", "LKE
Network Access Control List (IP ACL)", "Placement Group", "Object Storage Access
Key Regions"], "active_promotions": [], "euuid": "F959AD74-9386-4827-A426975C90B4EBD5"}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -38,13 +39,13 @@ interactions:
Connection:
- keep-alive
Content-Length:
- "776"
- "735"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- Mon, 17 Jun 2024 15:46:56 GMT
- Thu, 27 Jun 2024 20:41:57 GMT
Pragma:
- no-cache
Strict-Transport-Security:
Expand All @@ -60,7 +61,10 @@ interactions:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
- account:read_write databases:read_write domains:read_write events:read_write
firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write
longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write
volumes:read_write vpc:read_write
X-Ratelimit-Limit:
- "400"
X-Xss-Protection:
Expand Down
10 changes: 5 additions & 5 deletions test/integration/fixtures/TestFirewallRules_Get.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: 1
interactions:
- request:
body: '{"label":"linodego-fw-test","rules":{"inbound":[{"action":"ACCEPT","label":"go-fwrule-test","ports":"22","protocol":"TCP","addresses":{"ipv4":["0.0.0.0/0"],"ipv6":["::0/0"]}}],"inbound_policy":"ACCEPT","outbound":[{"action":"ACCEPT","label":"go-fwrule-test","ports":"22","protocol":"TCP","addresses":{"ipv4":["0.0.0.0/0"],"ipv6":["::0/0"]}}],"outbound_policy":"ACCEPT"},"tags":["testing"],"devices":{}}'
body: '{"label":"linodego-fw-test","rules":{"inbound":[{"action":"ACCEPT","label":"go-fwrule-test","ports":"22","protocol":"TCP","addresses":{"ipv4":["0.0.0.0/0"],"ipv6":["1234::5678/0"]}}],"inbound_policy":"ACCEPT","outbound":[{"action":"ACCEPT","label":"go-fwrule-test","ports":"22","protocol":"TCP","addresses":{"ipv4":["0.0.0.0/0"],"ipv6":["1234::5678/0"]}}],"outbound_policy":"ACCEPT"},"tags":["testing"],"devices":{}}'
form: {}
headers:
Accept:
Expand All @@ -17,9 +17,9 @@ interactions:
body: '{"id": 498946, "label": "linodego-fw-test", "created": "2018-01-02T03:04:05",
"updated": "2018-01-02T03:04:05", "status": "enabled", "rules": {"inbound":
[{"action": "ACCEPT", "label": "go-fwrule-test", "ports": "22", "protocol":
"TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["::/0"]}}], "inbound_policy":
"TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["1234::5678/0"]}}], "inbound_policy":
"ACCEPT", "outbound": [{"action": "ACCEPT", "label": "go-fwrule-test", "ports":
"22", "protocol": "TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["::/0"]}}],
"22", "protocol": "TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["1234::5678/0"]}}],
"outbound_policy": "ACCEPT", "version": 1, "fingerprint": "7bcc0f03"}, "tags":
["testing"], "entities": []}'
headers:
Expand Down Expand Up @@ -84,10 +84,10 @@ interactions:
method: GET
response:
body: '{"inbound": [{"action": "ACCEPT", "label": "go-fwrule-test", "ports": "22",
"protocol": "TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["::/0"]}}],
"protocol": "TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6": ["1234::5678/0"]}}],
"inbound_policy": "ACCEPT", "outbound": [{"action": "ACCEPT", "label": "go-fwrule-test",
"ports": "22", "protocol": "TCP", "addresses": {"ipv4": ["0.0.0.0/0"], "ipv6":
["::/0"]}}], "outbound_policy": "ACCEPT", "version": 1, "fingerprint": "7bcc0f03"}'
["1234::5678/0"]}}], "outbound_policy": "ACCEPT", "version": 1, "fingerprint": "7bcc0f03"}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand Down
Loading