Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: safety checks for buildbot scripts

Andrey Lushnikovab6e358c4de9
diff --git a/browser_patches/buildbots/buildbot-linux.sh b/browser_patches/buildbots/buildbot-linux.sh
index 109c3082c7..3e01081bdb 100755
--- a/browser_patches/buildbots/buildbot-linux.sh
+++ b/browser_patches/buildbots/buildbot-linux.sh
@@ -2,6 +2,11 @@
set -e
set +x
+if [[ $(uname) != "Linux" ]]; then
+ echo "ERROR: this script is desgined to be run on Linux. Can't run on $(uname)"
+ exit 1
+fi
+
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0)"
echo
diff --git a/browser_patches/buildbots/buildbot-mac-10.14.sh b/browser_patches/buildbots/buildbot-mac-10.14.sh
index 109c3082c7..19a7f14372 100755
--- a/browser_patches/buildbots/buildbot-mac-10.14.sh
+++ b/browser_patches/buildbots/buildbot-mac-10.14.sh
@@ -2,6 +2,17 @@
set -e
set +x
+if [[ "$(uname)" != "Darwin" ]]; then
+ echo "ERROR: this script is desgined to be run on OSX. Can't run on $(uname)"
+ exit 1
+fi
+
+MAC_MAJOR_MINOR_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+')
+if [[ $MAC_MAJOR_MINOR_VERSION != "10.14" ]]; then
+ echo "ERROR: this script is desgined to be run on OSX 10.14. Can't run on OSX $MAC_MAJOR_MINOR_VERSION"
+ exit 1
+fi
+
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0)"
echo
diff --git a/browser_patches/buildbots/buildbot-mac-10.15.sh b/browser_patches/buildbots/buildbot-mac-10.15.sh
index 5ab683752f..18c9b9fece 100755
--- a/browser_patches/buildbots/buildbot-mac-10.15.sh
+++ b/browser_patches/buildbots/buildbot-mac-10.15.sh
@@ -2,6 +2,18 @@
set -e
set +x
+if [[ "$(uname)" != "Darwin" ]]; then
+ echo "ERROR: this script is desgined to be run on OSX. Can't run on $(uname)"
+ exit 1
+fi
+
+MAC_MAJOR_MINOR_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+')
+if [[ $MAC_MAJOR_MINOR_VERSION != "10.15" ]]; then
+ echo "ERROR: this script is desgined to be run on OSX 10.15. Can't run on OSX $MAC_MAJOR_MINOR_VERSION"
+ exit 1
+fi
+
+
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0) [firefox|webkit]"
echo
diff --git a/browser_patches/buildbots/buildbot-windows.sh b/browser_patches/buildbots/buildbot-windows.sh
index 674016b984..2da840c7b4 100755
--- a/browser_patches/buildbots/buildbot-windows.sh
+++ b/browser_patches/buildbots/buildbot-windows.sh
@@ -2,6 +2,12 @@
set -e
set +x
+if [[ $(uname) != MINGW* ]]; then
+ echo "ERROR: this script is desgined to be run on MINGW. Can't run on $(uname)"
+ exit 1
+fi
+
+
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0)"
echo