Skip to content

Commit aa3ba06

Browse files
committed
Fixation and some smoketests
1 parent 23550bb commit aa3ba06

4 files changed

Lines changed: 89 additions & 3 deletions

File tree

Rakefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ namespace :test do
5050
task :install do
5151
ruby_exec(File.join("test", "smoke_install.rb"))
5252
end
53+
54+
desc "Run website installer smoke tests"
55+
task :website_installers do
56+
ruby_exec(File.join("test", "smoke_website_installers.rb"))
57+
end
5358
end
5459

5560
namespace :build do
@@ -65,6 +70,6 @@ namespace :build do
6570
end
6671

6772
desc "Run the full release verification pass"
68-
task verify: ["test:spec", "test:cli", "test:web", "test:lab", "test:install", "build:gem"]
73+
task verify: ["test:spec", "test:cli", "test:web", "test:lab", "test:install", "test:website_installers", "build:gem"]
6974

7075
task default: :verify

test/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ having to remember a long set of manual commands.
2020
- `bundle exec rake test:web`: verify web-session startup and routes
2121
- `bundle exec rake test:lab`: verify the local validation lab
2222
- `bundle exec rake test:install`: verify the installer flow for the current platform
23+
- `bundle exec rake test:website_installers`: verify website-distributed installer assets and syntax checks
2324

2425
## Latest verified status
2526

@@ -29,5 +30,5 @@ README verification notes.
2930
Latest verified repository result:
3031

3132
- `bundle exec rake` passed
32-
- `49 examples, 0 failures`
33-
- CLI, web-session, lab, installer, and gem-build smoke checks all passed
33+
- `52 examples, 0 failures`
34+
- CLI, web-session, lab, installer, website-installer, and gem-build smoke checks all passed

test/run_all.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
smoke_web.rb
2121
smoke_lab.rb
2222
smoke_install.rb
23+
smoke_website_installers.rb
2324
]
2425

2526
announce("Standalone verification run started.")

test/smoke_website_installers.rb

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# SPDX-License-Identifier: Proprietary
2+
#
3+
# ASRFacet-Rb: Attack Surface Reconnaissance Framework
4+
# Copyright (c) 2026 voltsparx
5+
#
6+
# Author: voltsparx
7+
# Repository: https://github.com/voltsparx/ASRFacet-Rb
8+
# Contact: voltsparx@gmail.com
9+
# License: See LICENSE file in the project root
10+
#
11+
# This file is part of ASRFacet-Rb and is subject to the terms
12+
# and conditions defined in the LICENSE file.
13+
14+
require_relative "support/smoke_helper"
15+
16+
include ASRFacet::TestSupport
17+
18+
def command_available?(name)
19+
lookup = windows? ? ["where", name] : ["which", name]
20+
_stdout, _stderr, status = Open3.capture3(*lookup)
21+
status.success?
22+
rescue StandardError
23+
false
24+
end
25+
26+
announce("Website installer smoke verification started.")
27+
28+
installers_dir = File.join(ROOT, "docs", "website", "web_assets", "installers")
29+
linux_rel = File.join("docs", "website", "web_assets", "installers", "asrfacet-rb-installer-linux.sh")
30+
macos_rel = File.join("docs", "website", "web_assets", "installers", "asrfacet-rb-installer-macos.sh")
31+
windows_ps_rel = File.join("docs", "website", "web_assets", "installers", "asrfacet-rb-installer-windows.ps1")
32+
windows_cmd_rel = File.join("docs", "website", "web_assets", "installers", "asrfacet-rb-installer-windows.cmd")
33+
readme_rel = File.join("docs", "website", "web_assets", "installers", "README.md")
34+
35+
expected_files = [linux_rel, macos_rel, windows_ps_rel, windows_cmd_rel, readme_rel]
36+
expected_files.each do |relative_path|
37+
full_path = File.join(ROOT, relative_path)
38+
assert(File.file?(full_path), "Missing website installer asset: #{relative_path}")
39+
end
40+
41+
linux_text = File.read(File.join(ROOT, linux_rel))
42+
macos_text = File.read(File.join(ROOT, macos_rel))
43+
windows_ps_text = File.read(File.join(ROOT, windows_ps_rel))
44+
windows_cmd_text = File.read(File.join(ROOT, windows_cmd_rel))
45+
readme_text = File.read(File.join(ROOT, readme_rel))
46+
47+
%w[install test update uninstall].each do |mode|
48+
assert(linux_text.include?(mode), "Linux website installer is missing mode '#{mode}'.")
49+
assert(macos_text.include?(mode), "macOS website installer is missing mode '#{mode}'.")
50+
assert(windows_ps_text.include?(mode), "Windows website installer is missing mode '#{mode}'.")
51+
end
52+
53+
assert(linux_text.include?("docs/images"), "Linux website installer must include docs/images sparse path.")
54+
assert(macos_text.include?("docs/images"), "macOS website installer must include docs/images sparse path.")
55+
assert(windows_ps_text.include?("docs/images"), "Windows website installer must include docs/images sparse path.")
56+
assert(windows_cmd_text.include?("asrfacet-rb-installer-windows.ps1"), "Windows CMD wrapper must call the PowerShell installer.")
57+
assert(readme_text.include?("docs/images"), "Installer README must document docs/images payload behavior.")
58+
59+
if command_available?("bash")
60+
run_command("bash", "-n", linux_rel, unbundled: true)
61+
run_command("bash", "-n", macos_rel, unbundled: true)
62+
else
63+
announce("Skipping shell syntax checks because bash is not available on this system.")
64+
end
65+
66+
windows_ps_abs = File.join(ROOT, windows_ps_rel).gsub("\\", "/")
67+
ps_parse_command = "[void][scriptblock]::Create((Get-Content -Raw '#{windows_ps_abs.gsub("'", "''")}')); 'parse-ok'"
68+
69+
if windows?
70+
parse_output = run_command("powershell", "-NoProfile", "-Command", ps_parse_command, unbundled: true)
71+
assert(parse_output.include?("parse-ok"), "PowerShell parser check did not return parse-ok.")
72+
elsif command_available?("pwsh")
73+
parse_output = run_command("pwsh", "-NoProfile", "-Command", ps_parse_command, unbundled: true)
74+
assert(parse_output.include?("parse-ok"), "pwsh parser check did not return parse-ok.")
75+
else
76+
announce("Skipping PowerShell syntax check because powershell/pwsh is not available on this system.")
77+
end
78+
79+
announce("Website installer smoke verification passed.")

0 commit comments

Comments
 (0)