Skip to content

Commit

Permalink
Merge pull request #1172 from SUSE/remove_ltss7_from_products
Browse files Browse the repository at this point in the history
Create migration to remove ltss7 from products
  • Loading branch information
digitaltom authored Jul 2, 2024
2 parents 770cbae + ca8e384 commit d72e38d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
7 changes: 7 additions & 0 deletions db/migrate/20240620111456_remove_ltss_7_from_products.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class RemoveLtss7FromProducts < ActiveRecord::Migration[6.1]
def change
products = Product.where(cpe: 'cpe:/o:suse:res-ha-ltss:7')

products.each(&:destroy)
end
end
18 changes: 10 additions & 8 deletions features/lockfile_spec.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
require File.expand_path('../support/command_rspec_helper', __FILE__)

describe 'rmt-cli' do
before do
`echo long_text_but_not_the_process_id > /tmp/rmt.lock`
`chown _rmt /tmp/rmt.lock`
`/usr/bin/rmt-cli sync > /dev/null &`
end
# kill running process to let further specs pass
after { `pkill -9 -f rmt-cli` }

describe 'lockfile' do

around do |example|
parent_pid = fork do
exec "/usr/bin/rmt-cli sync > /dev/null"
end
example.run
# wait for the parent process to finish, so the lock is released
Process.waitpid(parent_pid)
end

command '/usr/bin/rmt-cli sync', allow_error: true
its(:stderr) do
is_expected.to eq(
Expand Down

0 comments on commit d72e38d

Please sign in to comment.