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

[READY] - openwrt build follow up and github actions #817

Merged
merged 9 commits into from
Feb 1, 2025

Conversation

sarcasticadmin
Copy link
Member

@sarcasticadmin sarcasticadmin commented Jan 27, 2025

Description of PR

Relates to: #808
Fixes: #818

Follow up to: #814 #815 (since both merged prematurely) and fixing some things in github actions

Old Behavior

  • existing openwrt-build github action is failing due to incorrect user id
  • github actions: uplaod-artifacts@v3.x
  • templates had instructions that would render if not deleted before posting
  • github removed one of our tokens named: GITHUB_* (which is now unusable due to naming requirements of env vars)

New Behavior

Tests

$ rake spec TEST_TYPE=openwrt TARGET_HOST=192.168.254.113
/nix/store/xkmg185m7hv3c5dv6dsbmfs1c5vf92p6-ruby-3.1.6/bin/ruby -I/nix/store/7fl8vynr2x1vfi1d2slvhp07nmdhby35-serverspec/lib/ruby/gems/3.1.0/gems/rspec-core-3.12.2/lib:/nix/store/7fl8vynr2x1vfi1d2slvhp07nmdhby35-serverspec/lib/ruby/gems/3.1.0/gems/rspec-support-3.12.1/lib /nix/store/h751jn4jignpp48d60wlpq05ariv18r6-ruby3.1-rspec-core-3.12.2/lib/ruby/gems/3.1.0/gems/rspec-core-3.12.2/exe/rspec --pattern spec/openwrt/\*_spec.rb

Image info:
Linux OpenWrt 6.6.68 #0 Mon Jan 27 16:23:54 2025 mips GNU/Linux
SCALE_VER=fd9d58a6b451f6a2d5384f7c978cdad34046a810
OPENWRT_VER=c8ea1aa970bf5a0275e3b0b7da777e804821ddcd
BUILD_ID="r0-fd9d58a"
OPENWRT_BOARD="ath79/generic"
OPENWRT_ARCH="mips_24kc"

shared
  Command "which apinger 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which awk 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which bash 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which logrotate 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which rsyslogd 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which tcpdump 2> /dev/null"
    exit_status
      is expected to eq 0
  Command "which snmpd 2> /dev/null"
    exit_status
      is expected to eq 1
  Command "which dropbear 2> /dev/null"
    exit_status
      is expected to eq 1
  Command "which logd 2> /dev/null"
    exit_status
      is expected to eq 1
  Command "pgrep apinger"
    exit_status
      is expected to eq 0
  Command "pgrep crond"
    exit_status
      is expected to eq 0
  Command "pgrep rsyslogd"
    exit_status
      is expected to eq 0
  Command "pgrep lldpd"
    exit_status
      is expected to eq 0
  Command "pgrep ntpd"
    exit_status
      is expected to eq 0
  Port "80"
    is expected not to be listening
  Port "9100"
    is expected to be listening
  Command "rsyslogd -N1"
    exit_status
      is expected to eq 0
  Command "logger "serverspec test msg""
    exit_status
      is expected to eq 0
  File "/root/bin/wifi-details.sh"
    is expected to exist
    is expected to be mode 750
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/root/bin/config-version.sh"
    is expected to exist
    is expected to be mode 750
    is expected to be owned by "root"
    is expected to be grouped into "root"
  Command "/root/bin/config-version.sh"
    exit_status
      is expected to eq 0
  Command "/root/bin/config-version.sh -c 9999"
    exit_status
      is expected to eq 1
  File "/etc/scale-release"
    is expected to exist
    is expected to be mode 644
    is expected to be owned by "root"
    is expected to be grouped into "root"
  Command "source /etc/scale-release && test -z $SCALE_VER"
    exit_status
      is expected to eq 1
  Command "source /etc/scale-release && test -z $OPENWRT_VER"
    exit_status
      is expected to eq 1
  File "/tmp/resolv.conf.d/resolv.conf.auto"
    is expected to exist
    is expected to be mode 644
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/etc/resolv.conf"
    is expected to exist
    is expected to be symlink
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/etc/config/network"
    is expected to exist
    is expected to be symlink
    is expected to be owned by "root"
    is expected to be grouped into "root"
  File "/etc/config/wireless"
    is expected to exist
    is expected to be symlink
    is expected to be owned by "root"
    is expected to be grouped into "root"
  correct_num_configs
    should always be equal
  ensure_dhcp_client_options
    should contain the following options
  Command "cat /etc/apinger.conf | grep "^target \"$(ip route | grep default | cut -d ' ' -f 3)\"""
    exit_status
      is expected to eq 0
  Command "wifi status | jq '.[] | select(.up == false )' | wc -l"
    stdout
      is expected to eq "0\n"
  Command "awk -F: -v user='root' '$1 == user {print $NF}' /etc/passwd"
    stdout
      is expected to match /\/bin\/bash/
  ensure_admin_ssh_key_present
    should match the following key fingerprint

Finished in 12.22 seconds (files took 2.07 seconds to load)
56 examples, 0 failures
  • Regardless these 2 failed tests are actually passing upon further inspection

@sarcasticadmin
Copy link
Member Author

/tux openwrt flash 70-caravan-baboon

Copy link

[FAIL] - Error triggering gitlab flash pipeline

@sarcasticadmin
Copy link
Member Author

/tux openwrt flash 70-caravan-baboon

Copy link

[FAIL] - Error triggering gitlab flash pipeline

@sarcasticadmin sarcasticadmin changed the title [WAIT] - remove openwrt-build.yml docker user [WAIT] - openwrt build follow up Jan 29, 2025
@sarcasticadmin sarcasticadmin changed the title [WAIT] - openwrt build follow up [WAIT] - openwrt build follow up and github actions Jan 31, 2025
@@ -29,7 +29,7 @@ jobs:
# is not a PR event
REF=$(curl -sSf \
--url ${{ steps.pr-standardize-comment.outputs.url }} \
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Authorization: Bearer ${{ secrets.SCALE_GITHUB_TOKEN }}' \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cant test this further until it lands in master for the PR comment trigger to gitlab-ci, will do a follow up after we merge this though

Copy link
Member Author

@sarcasticadmin sarcasticadmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be fixing magic cache as a separate PR since we have a few more days to decide.

@sarcasticadmin sarcasticadmin changed the title [WAIT] - openwrt build follow up and github actions [READY] - openwrt build follow up and github actions Jan 31, 2025
.github/workflows/openwrt-build.yml Show resolved Hide resolved
- name: 'Upload openwrt build log'
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v4.6.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably never going to happen but do we want to use if-no-files-found: just in case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to both jobs

Copy link
Contributor

@djacu djacu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sarcasticadmin sarcasticadmin merged commit db3a7cb into master Feb 1, 2025
6 checks passed
@sarcasticadmin sarcasticadmin deleted the rh/issue-808-redux branch February 1, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deprecation notice: v1, v2, and v3 of the artifact github actions
2 participants